For example I have code below string txt="I have strings like West, and West; and west, and Western."
I would like to replace the word west or West with some other word. But I would like not to replace West in Western.
inputText.Replace("(\\sWest.\\s)",temp);
It dos not work.To replace the whole word (rather than part of the word):
string s = "Go west Life is peaceful there";
s = Regex.Replace(s, @"\bwest\b", "something");