I need to pre-process a string and remove some words from it. what i am looking for is something like:-
private static final String[] stopWords = { "is", "on", "of", "with"};
String s1 = "Tiger is Mammal with sharp teeth";
System.out.println("s1 = " + s1); // "Tiger is Mammal with sharp teeth"
s1.remove(stopWords); //remove should remove 'is' and 'with' from s1
System.out.println("s1 = " + s1); // "Tiger Mammal sharp teeth"
I am new to programming so please do consider.