【发布时间】:2010-04-22 03:44:29
【问题描述】:
如何查找和替换文本文件中的“Enter”字符?这是我的代码:
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++; }
【问题讨论】:
-
你有什么问题?
-
乔治,它不知何故没有检测到 Enter 字符。
标签: visual-c++ char