【发布时间】:2017-06-19 09:37:09
【问题描述】:
我想删除一个大字符串(不是文件)中的空行。 这是字符串:
The unique begin of a line in my string, after that a content same endline
The unique begin of a line in my string, after that a content same endline
The unique begin of a line in my string, after that a content same endline
这是它在记事本++上的显示方式:
【问题讨论】:
-
你永远不会初始化
OldCaractere、NumberReturnCaractere、NumberDoubleReturnCaractere,所以它们包含垃圾。 -
为什么不使用 strstr 来查找 \n\n 或类似的东西?
-
既然您有这个要求,您能否将您的设计更改为
std::vector<std::string>>或std::list<std::string>>,其中外部容器中的每个元素都是原始文本的一行? -
我无法更改设计。
标签: c++ char newline carriage-return blank-line