MCPcopy Index your code
hub / github.com/apache/orc / removeChars

Function removeChars

tools/test/TestFileScan.cc:84–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::string removeChars(const std::string& input, const std::string& chars) {
85 std::string result;
86 size_t prev = 0;
87 size_t pos = input.find_first_of(chars);
88 while (pos != std::string::npos) {
89 if (pos > prev) {
90 result += input.substr(prev, pos - prev);
91 }
92 prev = pos + 1;
93 pos = input.find_first_of(chars, prev);
94 }
95 pos = input.length();
96 if (pos > prev) {
97 result += input.substr(prev, pos - prev);
98 }
99 return result;
100}
101
102TEST(TestFileScan, testRemoveChars) {
103 EXPECT_EQ("abcdef", removeChars("abcdef", "xyz"));

Callers 1

TESTFunction · 0.85

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected