The replace
method is what you’re looking for.
For example:
String replacedString = someString.replace("HelloBrother", "Brother");
More Related Contents:
- How to add to string number and keep string in Java?
- Why is char[] preferred over String for passwords?
- Java: splitting a comma-separated string but ignoring commas in quotes
- How do I convert from int to String?
- Garbage collection of String literals
- How to convert a char to a String?
- how to convert java string to Date object [duplicate]
- How do I make my string comparison case-insensitive?
- How to remove the last character from a string?
- How to get a string between two characters?
- Java: method to get position of a match in a String?
- How to replace special characters in a string?
- String contains – ignore case [duplicate]
- Java – removing first character of a string
- How to print the whole String pool?
- How can I trim beginning and ending double quotes from a string?
- How do I convert a byte array with null terminating character to a String in Java?
- Android coding with switch (String)
- What is the difference between String and StringBuffer in Java?
- How to remove large if-else-if chain [duplicate]
- Java – checking if parseInt throws exception
- Find all numbers in the String [closed]
- How to parse this string in Java?
- Sorting ArrayList of Objects by Object attribute
- What’s the best way to check if a String contains a URL in Java/Android?
- What’s the quickest way to compare strings in Java?
- Random element from string array [closed]
- Hints for java.lang.String.replace problem? [duplicate]
- How to convert a Java String to an ASCII byte array?
- What is difference between mutable and immutable String in java