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

Function TrimString

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

Source from the content-addressed store, hash-verified

150static constexpr bool IsWhitespace(char c) { return c == ' ' || c == '\t'; }
151
152std::string TrimString(std::string value) {
153 size_t ltrim_chars = 0;
154 while (ltrim_chars < value.size() && IsWhitespace(value[ltrim_chars])) {
155 ++ltrim_chars;
156 }
157 value.erase(0, ltrim_chars);
158 size_t rtrim_chars = 0;
159 while (rtrim_chars < value.size() &&
160 IsWhitespace(value[value.size() - 1 - rtrim_chars])) {
161 ++rtrim_chars;
162 }
163 value.erase(value.size() - rtrim_chars, rtrim_chars);
164 return value;
165}
166
167bool AsciiEqualsCaseInsensitive(std::string_view left, std::string_view right) {
168 // TODO: ASCII validation

Callers 7

ParseCookieAttributeMethod · 0.85
ConvertCookieDateMethod · 0.85
SplitCookiesMethod · 0.85
AddTableTypeFunction · 0.85
TESTFunction · 0.85
OsRetrieveCpuInfoFunction · 0.85

Calls 2

IsWhitespaceFunction · 0.70
sizeMethod · 0.45

Tested by 2

SplitCookiesMethod · 0.68
TESTFunction · 0.68