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 repla
you can use pattern matcher as well, which will replace all in one shot.
Pattern keyPattern = Pattern.compile(key); Matcher matcher = keyPattern.matcher(str); String nerSrting = matcher.replaceAll(value);