How can I get a string after a specific substring?
For example, I want to get the string after "world" in
my_string="hello python world, I'm a beginner"
…which in this case is: ", I'm a beginner")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way is probably just to split on your target word
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.