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

Function ltrim_utf8

cpp/src/gandiva/precompiled/string_ops.cc:325–341  ·  view source on GitHub ↗

Trims whitespaces from the left end of the input utf8 sequence

Source from the content-addressed store, hash-verified

323
324// Trims whitespaces from the left end of the input utf8 sequence
325FORCE_INLINE
326const char* ltrim_utf8(gdv_int64 context, const char* data, gdv_int32 data_len,
327 int32_t* out_len) {
328 if (data_len == 0) {
329 *out_len = 0;
330 return "";
331 }
332
333 gdv_int32 start = 0;
334 // start denotes the first position of non-space characters in the input string
335 while (start < data_len && data[start] == ' ') {
336 ++start;
337 }
338
339 *out_len = data_len - start;
340 return data + start;
341}
342
343// Trims whitespaces from the right end of the input utf8 sequence
344FORCE_INLINE

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68