Belgi Belgi - 11 months ago 50
Java Question

How can I remove a substring from a given String?

Is there an easy way to remove substring from a given String in Java ?

example : "Hello World!" , removing "o" - > "Hell Wrld!"

Answer Source

You could easily use String.replace():

String helloWorld = "Hello World!";
String hellWrld = helloWorld.replace("o","");