SplitString don't clean

This commit is contained in:
Ruud
2013-06-22 01:37:27 +02:00
parent bc8d8dcd04
commit 9bb99319ba
2 changed files with 16 additions and 8 deletions
+3 -2
View File
@@ -181,5 +181,6 @@ def possibleTitles(raw_title):
def randomString(size = 8, chars = string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
def splitString(str, split_on = ','):
return filter(None, [x.strip() for x in str.split(split_on)] if str else [])
def splitString(str, split_on = ',', clean = True):
list = [x.strip() for x in str.split(split_on)] if str else []
return filter(None, list) if clean else list