I have a string like this:
Durham * versus Yorkshire
and I have used a regex in C# to replace that asterisk in the string with some text, as:
string aString = "Durham * versus Yorkshire";
string newstring = Regex.Replace( aString, @"\*", "Replaced text");
I want this output:
Durham Replaced Text versus Yorkshire
but this is not working. I thought that escaping the *
with a \
will find it. But its not. You can test it here as well: RegExr.
Can somebody tell me where am I wrong?