Remove multiple substrings from a string - Java
I need to remove multiple substrings from a given String. Example -
String[] exclude = {"one","two","three"};
String input = "if we add one and two we get three"
I want my program to remove all occurrences of "one" or "two" or "three"
from the input string and return -
"if we add and we get"
How can i do this in Java ?
No comments:
Post a Comment