You can use replaceFirst(String regex, String replacement)
method of String.
More Related Contents:
- Replace a character specific number of times in String Java
- String replace method is not replacing characters
- Replace a character at a specific index in a string?
- Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces
- Difference between String replace() and replaceAll()
- Java String replace not working [duplicate]
- Java Replacing multiple different substring in a string at once (or in the most efficient way)
- Strip Leading and Trailing Spaces From Java String
- How can non-ASCII characters be removed from a string?
- How to replace case-insensitive literal substrings in Java
- Replace the last part of a string
- Why does String.replace not work? [duplicate]
- String replace a Backslash
- Java String.replace/replaceAll not working
- String.replaceAll is considerably slower than doing the job yourself
- Remove all occurrences of \ from string
- Replace Last Occurrence of a character in a string [duplicate]
- Hints for java.lang.String.replace problem? [duplicate]
- How to convert Java String into byte[]?
- ArrayList initial capacity and IndexOutOfBoundsException [duplicate]
- CharSequence VS String in Java?
- Java String array: is there a size of method?
- Can I add new methods to the String class in Java?
- Extract the difference between two strings in Java
- How do I check if a char is a vowel?
- What is a good 64bit hash function in Java for textual strings?
- Simple way to sort strings in the (case sensitive) alphabetical order
- what is Ljava.lang.String;@
- Is there a difference between String concat and the + operator in Java? [duplicate]
- Java String literal pool and string object