The techie in me RSS 2.0
 Saturday, April 10, 2010

String.Replace is not case insensitive, so what is the best way to do it. There are several ways, if I think of the quickest one it is using regex.

using System.Text.RegularExpressions;string 
string str = "The quick brown Fox jumps over the lazy dog";
string strReplace = "cat";
string result = Regex.Replace(str, "fox", strReplace, RegexOptions.IgnoreCase);

-Rujith

 

Saturday, April 10, 2010 10:18:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] -
Coding
Thursday, June 03, 2010 2:20:55 PM (GMT Standard Time, UTC+00:00)
nice one... thanks
Kswar
Comments are closed.
About me
Name : Rujith Anand Send mail to the author(s)
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Blogs I read
Disclaimer

Disclaimer
Postings are provided as is with no warranties, and confer no rights. Opinions expressed here are my own delusions; my employers at best shake their heads and sigh, at worst repudiate the content with extreme prejudice, whenever it manages to appear on their radar.

© Copyright 2012
Rujith Anand

Statistics
Advertisement
All Content © 2012, Rujith Anand