I have a string called \"hello world\"
I need to replace the word \"world\" to \"csharp\"
for this I use:
string.Replace(\"World\", \"csharp\
You could use a Regex and perform a case insensitive replace:
class Program { static void Main() { string input = "hello WoRlD"; string result = Regex.Replace(input, "world", "csharp", RegexOptions.IgnoreCase); Console.WriteLine(result); // prints "hello csharp" } }