i want to remove an array of stop words from input string, and I have the following procedure
string[] arrToCheck = new string[] { \"try \", \"yourself\", \
shorten your code, and use LINQ
string[] arrToCheck = new string[] { "try ", "yourself", "before " }; var test = new StringBuilder("Did you try this yourself before asking"); arrToCheck.ForEach(x=> test = test.Replace(x, "")); Console.Writeln(test.ToString());