MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / trim_start

Function trim_start

modules/core/core/include/OpenString/text_view.h:327–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 }
326
327 [[nodiscard]] constexpr text_view trim_start(const text_view& text_set = text_view(u8" \t")) const noexcept
328 {
329 if(this->is_empty())
330 return { };
331 if(text_set.is_empty())
332 return *this;
333 auto iterator = this->begin();
334 const u64 size = this->size();
335 for(u64 i = 0; i < size; ++i)
336 {
337 if(const auto cp = *iterator; !text_set.contains(cp))
338 return this->subview(i);
339 ++iterator;
340 }
341 return { };
342 }
343
344 [[nodiscard]] constexpr text_view trim_end(const text_view& text_set = text_view(u8" \t")) const noexcept
345 {

Callers

nothing calls this directly

Calls 6

text_viewFunction · 0.85
is_emptyMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45
subviewMethod · 0.45

Tested by

no test coverage detected