So i have some strings which I want to replace some occurrences of brackets in.
Now this is what I've done so far. And it works
string answerText = "This is an [example] string";
Match match = Regex.Match(answerText, @"\[(.*?)\]");
if(match.Success)
{
if(match.Value.Equals("[example]"))
{
answerText = answerText.Replace(match.Value, "awsome");
}
}
What I'm trying to figure out is how to make this happen if the answer text looks something like this
string answerText = "This is an [example1] [example2] [example3] string";