How to Find and Replace the Enter character?
- by karikari
How to Find and Replace the 'Enter' characters in the text file? Here is my code:
string searchString( "\r" ); // <------- how to look for ENTER chars?
string replaceString( "XXXX" );
assert( searchString != replaceString );
string::size_type pos = 0, pos3 =0;
while ( (pos = test.find(searchString, pos)) != string::npos ) {
test.replace( pos, searchString.size(), replaceString );
pos++; }