mirror of
https://github.com/cooperhammond/irs.git
synced 2025-07-01 14:58:14 +00:00
Better option
This commit is contained in:
parent
f01fd21ef9
commit
c2b0573040
|
@ -98,7 +98,7 @@ 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.encode("utf8"))
|
string = regex.sub('', string.encode('ascii', 'ignore'))
|
||||||
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