replace String with another in java

The replace method is what you’re looking for.

For example:

String replacedString = someString.replace("HelloBrother", "Brother");

Leave a Comment