MCPcopy Create free account
hub / github.com/apache/orc / stripPrefix

Function stripPrefix

tools/test/TestFileScan.cc:75–82  ·  view source on GitHub ↗

* This function locates the goal substring in the input and removes * everything before it. * stripPrefix("abcdef", "cd") -> "cdef" * stripPrefix("abcdef", "xx") -> "abcdef" */

Source from the content-addressed store, hash-verified

73 * stripPrefix("abcdef", "xx") -> "abcdef"
74 */
75std::string stripPrefix(const std::string& input, const std::string& goal) {
76 size_t loc = input.find(goal);
77 if (loc == std::string::npos) {
78 return input;
79 } else {
80 return input.substr(loc);
81 }
82}
83
84std::string removeChars(const std::string& input, const std::string& chars) {
85 std::string result;

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected