I have a string, which after a character I wish to remove everything after the character. However, the issue is that I have multiple characters like this in the string and its only the characters after the last one which I wish to remove.
for example:
str = "howdie how are you? are you good? sdfsdf"
str = str.RemoveEverythingAfterLast("?")
str = "howdie how are you? are you good?"
I was wondering if there was an efficient way to do this in python? I had thought of looping backwards through the string deleting characters 1 by 1 until I found the character I was looking for (in example the '?'). But I was wondering if there was a more efficient way to go about this?