A simple question about 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:38 UTC
Read the original article Hit count: 405

Filed under:
|
|
|

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.

  1. Can I use regular expression in string.replace? I used inputText.Replace("(\\sWest.\\s)",temp); It dos not work.

© Stack Overflow or respective owner

Related posts about c#

Related posts about text