how can i get a string after a specific substring .
For example I want to get the string after
my_string="hello python world , i'm a beginner "
The easiest way is probably just to split on your target word
my_string="hello python world , i'm a beginner " print my_string.split("world",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.
Or you could do this:
In : print my_string.split(", ",1) i'm a beginner