Help remove unwanted words with match
in
Programming Questions
•
8 months ago
I created an array of unwanted words and want to use match to iterate through and see if the string contains any of those keywords. Problem is, I keep getting some of the unwanted words show up. Please help.
- String msg = "The colors of the rainbow";
- String[] filter = {"orange", "yellow", "green"};
- for (int f = 0; f < filter.length; f++) {
- if(matchAll(msg, filter[f]) == null) {
- //some code here
- }
- }
1