Rremove the space before the keyword or remove the word from an array of sentences and return the new array

All right. Can you try the following expression?

arrRes.Select(Function(s) System.Text.RegularExpressions.Regex.Replace(s,"(?<=\b"+Stringvar1+") (?="+Stringvar2+"\b)| "+Stringvar2+"\b","")).ToArray

Regards,

1 Like