MCPcopy Create free account
hub / github.com/cuberite/cuberite / StringSplitAndTrim

Function StringSplitAndTrim

src/StringUtils.cpp:145–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144
145AStringVector StringSplitAndTrim(const AString & str, const AString & delim)
146{
147 AStringVector results;
148 size_t cutAt = 0;
149 size_t Prev = 0;
150 while ((cutAt = str.find_first_of(delim, Prev)) != str.npos)
151 {
152 results.push_back(TrimString(str.substr(Prev, cutAt - Prev)));
153 Prev = cutAt + 1;
154 }
155 if (Prev < str.length())
156 {
157 results.push_back(TrimString(str.substr(Prev)));
158 }
159 return results;
160}
161
162
163

Callers 11

ResolveItemMethod · 0.85
SetDefStringMethod · 0.85
AddFromStringMethod · 0.85
LoadGroupsMethod · 0.85
StartMethod · 0.85
tolua_StringSplitAndTrimFunction · 0.85
ParseCharMapMethod · 0.85
ParseConnectorsMethod · 0.85
InitFinishGensMethod · 0.85
CreateSocketsMethod · 0.85

Calls 1

TrimStringFunction · 0.85

Tested by

no test coverage detected