string replace first java

replaceFirst() String Example

After seeing replace() method in String, let us study another similar method replaceFirst() String. What Java API says about the method: String replaceFirst (String str, String replaceString): Replaces the first occurrence of str in the original string(calling string) with replaceString, The original string is not getting disturbed, but the returned…