What is the initial code for the string.split() function in python? -
i want know code .split() function in python (simple way nice). newb python , couldn't figure out myself. help?
edit: here's have far...
stringinput = str(input("give me string: ")) mylist = [] firstpointer = 0 secondpointer = 0 x in stringinput: secondpointer += 1 if (stringinput[firstpointer] == chr(32)):#ascii 32 space character stringinput +=1 mylist = stringinput[firstpointer, secondpointer]
i presume doing learning exercise. after have read tutorial, imitating string methods 1 way learn. .split 1 of harder ones.
s = '''this \tstring split''' sl = [] = none # start of 'word' j, c in enumerate(s + ' '): if c.isspace(): if not none: sl.append(s[i:j]) = none else: if none: = j print(sl) # ['this', 'is', 'a', 'string', 'to', 'be', 'split']
Comments
Post a Comment