MCPcopy Create free account
hub / github.com/apache/arrow / SplitString

Function SplitString

cpp/src/arrow/util/string.cc:107–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105namespace internal {
106
107std::vector<std::string_view> SplitString(std::string_view v, char delimiter,
108 int64_t limit) {
109 std::vector<std::string_view> parts;
110 size_t start = 0, end;
111 while (true) {
112 if (limit > 0 && static_cast<size_t>(limit - 1) <= parts.size()) {
113 end = std::string::npos;
114 } else {
115 end = v.find(delimiter, start);
116 }
117 parts.push_back(v.substr(start, end - start));
118 if (end == std::string::npos) {
119 break;
120 }
121 start = end + 1;
122 }
123 return parts;
124}
125
126template <typename StringLike>
127static std::string JoinStringLikes(const std::vector<StringLike>& strings,

Callers 6

InitMethod · 0.85
TESTFunction · 0.85
InitMethod · 0.85
ExecuteMethod · 0.85

Calls 4

push_backMethod · 0.80
substrMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45

Tested by 3

TESTFunction · 0.68
InitMethod · 0.68