G
groleo
Hi.
I have the following string:
string s = "hello\W\n";
If I do this: std::cout << s; i would get "helloW"
How can I replace the \ within the string, so when I print it out, I
would get:
"hello\W"??
I tried like this:
string backslash ="\\";
unsigned int loc = 0;
do{
loc = until_regex.find( backslash[0], 0 );
if ( loc == string::npos)
break;
until_regex.replace( loc, 2,"A" );
}while( loc != string::npos );
but no luck.
I have the following string:
string s = "hello\W\n";
If I do this: std::cout << s; i would get "helloW"
How can I replace the \ within the string, so when I print it out, I
would get:
"hello\W"??
I tried like this:
string backslash ="\\";
unsigned int loc = 0;
do{
loc = until_regex.find( backslash[0], 0 );
if ( loc == string::npos)
break;
until_regex.replace( loc, 2,"A" );
}while( loc != string::npos );
but no luck.