Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split on first occurrence

str.split([sep[, maxsplit]])
s = "123mango abcd mango kiwi peach"
s.split("mango", 1)
['123', ' abcd mango kiwi peach']
>>> s.split("mango", 1)[1]
' abcd mango kiwi peach'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #split #occurrence
ADD COMMENT
Topic
Name
2+2 =