MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / trimRightTrailingSpaces

Function trimRightTrailingSpaces

memo/listnode.cpp:53–57  ·  view source on GitHub ↗

base 从其 reverse_iterator还原基础迭代器,因为 earse 参数只能是基础迭代器

Source from the content-addressed store, hash-verified

51
52// base 从其 reverse_iterator还原基础迭代器,因为 earse 参数只能是基础迭代器
53void trimRightTrailingSpaces(string &input) {
54 input.erase(find_if(input.rbegin(), input.rend(), [](int ch) {
55 return !isspace(ch);
56 }).base(), input.end());
57}
58
59// 字符串输入转 vector:[1,2,3,4,5]
60vector<int> stringToIntegerVector(string input) {

Callers 1

stringToIntegerVectorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected