I want to insert a specific character ("+") in front of the character "b" as part of a string in R. So for example "2b^3" should be converted to "2+b^3" or "200b" to "200+b". How can I achieve this?
Edit: I have a follow up question to the one before:
I have tried this answer: Extract a substring according to a pattern
But it doesn't work for ^:
string = "2+b^3"
sub(".*^", "", string)
gives me still "2+b^3" and I would like to receive "3".
What can I do?