There is a list of banned words ( or strings to be more general) and another list with let's say users mails. I would like to excise all banned words from all mails.
trivial example:
foreach(string word in wordsList)
{
foreach(string mail in mailList)
{
mail.Replace(word,String.Empty);
}
}
how I can improve this algorithm?
Edit:
Thanks for advices. I voted few answers up but i didnt mark any as answer since it was more like discusion than solution. BTW. Some ppl missed banned words with bad words. In my case I dont have to bother about recognize 'sh1t' or something like that ;-)