Can I use regular expressions with String.Replace in C#?
Posted
by Taz
on Stack Overflow
See other posts from Stack Overflow
or by Taz
Published on 2010-05-05T06:30:27Z
Indexed on
2010/05/05
6:48 UTC
Read the original article
Hit count: 361
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.
- Can I use regular expression in string.replace? I used
inputText.Replace("(\\sWest.\\s)",temp);
It dos not work.
© Stack Overflow or respective owner