I need to replace all occurrences of \b
with <b>
and all occurrences of \b0
with </b>
in the following example:
The quick \b brown fox\b0 jumps over the \b lazy dog\b0.. Thanks
Regular expressions is massive overkill for this (and it often is). A simple:
string replace = text.Replace(@"\b0", "</b>")
.Replace(@"\b", "<b>");
will suffice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With