I have a sentence that may have “not, or” inside.
Currently, I’m trying to test and remove these words, however, I couldn’t figure out how to write a correct regex test pattern, can someone help please?
I tried with
string test= "";
string str=" some words here ";
if (str.ToLower().Contains(" not ")) {
test = str.ToLower().Replace(" not ", " ");
} else if (str.ToLower().Contains(" or ")) {
test = str.ToLower().Replace(" or ", " ");
}
I think you mean to replace “not” and “or”