i want to replace some string(s) from a source string. so that shouldn’t be changed upper/lowercase of source string. how i can do this? I’m using Replace .NET string type method such below:
var source = "Sadegh";
var word = "sadegh";
var replaced = source.Replace(word, "<strong>" + word + "</strong>");
and replace is: sadegh but i want Sadegh
thanks in advance.
Do this: http://weblogs.asp.net/jgalloway/archive/2004/02/11/71188.aspx
String.Replace is not good for that. Regex replace is okay.