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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -