I want to replace string which is a square bracket with another number. I am using regex replace method.
Sample input:
This is [test] version.
Required output (replacing "[test]" with 1.0):
This is 1.0 version.
Right now regex is not replacing the special character. Below is the code which I have tried:
string input= "This is [test] version of application.";
string stringtoFind = string.Format(@"\b{0}\b", "[test]");
Console.WriteLine(Regex.Replace(input, stringtoFind, "1.0"));
There may be any special character in input and stringtoFind variables.