I made a comment above, asking why the name was changed to suggest that Regex should have been used.
I personally try not to use Regex because it is slow. Regex is great for complex string patterns, but if string replacements are simple and you need some kind of performance, I will try to find a way without using Regex.
Made a test. Launch a million replicas using the Regex and string methods.
Regex took 26.5 seconds to execute string methods for 8 seconds .
Crispy
source share