I would like to have alternative separator when calling string.split()
>>> import string
>>> string.split('a n', ' ')
['a', 'n']
which is correct.
>>> string.split('a n"c', ' "')
['a n"c']
>>> string.split('a n"c', '[ |"]')
['a n"c']
The ideal split should be ['a', 'n', 'c']
.
>>> string.split('a n" "c', '[ |"]')
['a n" "c']
>>> string.split('a n" "c', ' "')
['a n"', 'c']
The ideal split should be ['a', 'n', 'c']
.
So I wonder how can I do that?