Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split string after substring

my_string="hello python world , i'm a beginner "
print my_string.split("world",1)[1]

#split takes the word(or character) to split on and optionally a limit to the number of splits.
#In this example split on "world" and limit it to only one split.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #split #string #substring
ADD COMMENT
Topic
Name
2+7 =