> string []swear= { "swearword1", "swearword2", "swearword3"
> };
> string=" Here is some type of string a user owuld enter "
Huh?
> for(int i=0; i< swear.size(); i++)
> if(str.indexOf(swear[i])>=0)
> replace.All(swear[i], "***")
public class MyFiler {
public static void main(String args[]) {
string input = "Parse this sentance";
StringTokenizer st = new StringTokenizer(input);
while (st.hasMore()) {
String word = st.next();
for (int i=0; i<swear.length(); i++) {
if(swear[i].equals(word)) {
word="*";
}
}
}
}
}