i want to remove an array of stop words from input string, and I have the following procedure
string[] arrToCheck = new string[] { \"try \", \"yourself\", \
For a simple way to remove a list of strings from your sentence, and aggregate the results back together, you can do the following:
var input = "Did you try this yourself before asking";
var arrToCheck = new [] { "try ", "yourself", "before " };
var result = input.Split(arrToCheck,
arrToCheck.Count(),
StringSplitOptions.None)
.Aggregate((first, second) => first + second);
This will break your original string apart by your word delimiters, and create one final string using the result set from the split array.
The result will be, "Did you this before asking"