MCPcopy Create free account
hub / github.com/chen3feng/toft / DoRemoveLineEnding

Function DoRemoveLineEnding

base/string/algorithm.cpp:160–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158
159template <typename StringType>
160void DoRemoveLineEnding(StringType* line)
161{
162 while (!line->empty())
163 {
164 char last = (*line)[line->length() - 1];
165 if (last == '\r' || last == '\n')
166 line->resize(line->length() - 1);
167 else
168 break;
169 }
170}
171
172void RemoveLineEnding(std::string* line)
173{

Callers 1

RemoveLineEndingFunction · 0.85

Calls 3

resizeMethod · 0.80
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected