replace first occurrence of character in string csharp

Code Example - replace first occurrence of character in string csharp

                
                        var regex = new Regex(Regex.Escape("o"));
var newText = regex.Replace("Hello World", "Foo", 1);