I need to replace all matching words or special characters in a string, but cant figure out a way to do so.
For example i have a string: "This - is a great victory"
I need to replace all -
with +
signs. Or great
with unpleasant
- user selects a word to be replaced and gives replacement for it.
"\\b"+originalTex+"\\b"
was working fie until i realised that \b does work only with word characters.
So the question is: what is replacement for \b would let me replace any matching word that is enclosed by whitespaces?
EDIT: I can not remove word boundaries as it would result inexact match. For example: you are creator of your world, while change you, your also would be changed. as it contains "you"