Skip to main content
Format variable name
Source Link
Peter B
  • 24.7k
  • 5
  • 42
  • 94

You're overwriting the resultresult variable throughout the loop repeatedly, there doesn't seem to be any need for it either, just use the input variable

input = Regex.Replace(input, pattern[i], replacement);
...
Console.WriteLine(input);

You're overwriting the result variable throughout the loop repeatedly, there doesn't seem to be any need for it either, just use the input variable

input = Regex.Replace(input, pattern[i], replacement);
...
Console.WriteLine(input);

You're overwriting the result variable throughout the loop repeatedly, there doesn't seem to be any need for it either, just use the input variable

input = Regex.Replace(input, pattern[i], replacement);
...
Console.WriteLine(input);
Source Link
Sayse
  • 43.4k
  • 14
  • 85
  • 150

You're overwriting the result variable throughout the loop repeatedly, there doesn't seem to be any need for it either, just use the input variable

input = Regex.Replace(input, pattern[i], replacement);
...
Console.WriteLine(input);