Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python string to list without split

sentence = 'This is a sentence'
split_value = []
tmp = ''
for c in sentence:
    if c == ' ':
        split_value.append(tmp)
        tmp = ''
    else:
        tmp += c
if tmp:
    split_value.append(tmp)
Source by www.thetopsites.net #
 
PREVIOUS NEXT
Tagged: #python #string #list #split
ADD COMMENT
Topic
Name
6+4 =