I am searching for the following text in an input string: +Bob
If the program finds +Bob, I want it to remove the + before Bob
However, I do not want the program to eliminate all +‘s, just +‘s before or after Bob, with or without intervening whitespace. So a string for example of: + Bob still counts as +Bob.
To handle a space between
+andBobyou can use regular expressions:To check for a plus afterwards, use