I want to replace first occurrence of String in the following.
String test = \"see Comments, this is for some test, help us\"
**If test c
You can use following statement to replace first occurrence of literal string with another literal string:
String result = input.replaceFirst(Pattern.quote(search), Matcher.quoteReplacement(replace));
However, this does a lot of work in the background which would not be needed with a dedicated function for replacing literal strings.