mirror of
https://github.com/cooperhammond/irs.git
synced 2024-12-31 18:55:28 +00:00
Once more?
This commit is contained in:
parent
5d2537b236
commit
fa64378c2b
|
@ -98,7 +98,10 @@ class ObjManip: # Object Manipulation
|
||||||
def blank(string, downcase=True):
|
def blank(string, downcase=True):
|
||||||
import re
|
import re
|
||||||
regex = re.compile('[^a-zA-Z0-9\ ]')
|
regex = re.compile('[^a-zA-Z0-9\ ]')
|
||||||
string = regex.sub('', string.decode("utf8"))
|
if sys.version_info == 2:
|
||||||
|
string = regex.sub('', string.decode("utf8"))
|
||||||
|
else:
|
||||||
|
string = regex.sub('', string)
|
||||||
if downcase:
|
if downcase:
|
||||||
string = string.lower()
|
string = string.lower()
|
||||||
return ' '.join(string.decode().split())
|
return ' '.join(string.decode().split())
|
||||||
|
|
Loading…
Reference in a new issue