B
Blue
$string = "aaa ' ccc ";
$string =~ s/'/bbb/eg;
The above replaces the single-quotation mark with bbb. The result will
be:
aaa bbb ccc
How do I modify it so that the single-quotation mark is replaced with
\' (a backslash and a single-quotation mark) resulting in:
aaa \' ccc
$string =~ s/'/bbb/eg;
The above replaces the single-quotation mark with bbb. The result will
be:
aaa bbb ccc
How do I modify it so that the single-quotation mark is replaced with
\' (a backslash and a single-quotation mark) resulting in:
aaa \' ccc