K
Kian Goh
Hello,
I would like to replace all the occurrence of "(" and ")"
in C++ std::string to "\(" and "\)".
For example:
string s = "(abc)|(toto)|(lala)"
will be become "\(abc\)|\(toto\)|\(lala\)"
Question:
Just wonder if there is a straight forward function to do so??
Currently I am using a while loop to read through the string, then
basic_string::find and basic_string::replace the occurrence of "(" and ")".
Any better solution?
Thanks,
Kian
I would like to replace all the occurrence of "(" and ")"
in C++ std::string to "\(" and "\)".
For example:
string s = "(abc)|(toto)|(lala)"
will be become "\(abc\)|\(toto\)|\(lala\)"
Question:
Just wonder if there is a straight forward function to do so??
Currently I am using a while loop to read through the string, then
basic_string::find and basic_string::replace the occurrence of "(" and ")".
Any better solution?
Thanks,
Kian