I'm looking for the best approach for string find and replace in Java.
This is a sentence: "My name is Milan, people know me as Milan Vasic".
I want to replace the string Milan with Milan Vasic, but on place where I have already Milan Vasic, that shouldn't be a case.
after search/replace result should be: "My name is Milan Vasic, people know me as Milan Vasic".
I was try to use indexOf() and also Pattern/Matcher combination, but neither of my results not looks elegant, does someone have elegant solution?
cheers!