Split a string only by first space in python -
i have string example: "238 neo sports". want split string first space. output should ["238","neo sports"]. 1 way think split() , adding other two. other way so?
just pass count second parameter inside split function.
>>> s = "238 neo sports" >>> s.split(" ", 1) ['238', 'neo sports']
Comments
Post a Comment