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

Method split

modules/core/core/src/string/OpenString/text.cpp:445–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443 }
444
445 u32 text::split(const text_view& splitter, sequence<text_view>& pieces, const bool cull_empty) const noexcept
446 {
447 text_view view = this->view();
448 u32 count = 0;
449 while(true)
450 {
451 const auto [ left, right ] = view.split(splitter);
452 if(!cull_empty || !left.is_empty())
453 pieces.push_back(left);
454 ++count;
455 if(right.is_empty())
456 break;
457 view = right;
458 }
459 return count;
460 }
461
462 text& text::replace(const text_view& destination, const text_view& source, const u64 from, const u64 size)
463 {

Callers 1

__init__Method · 0.45

Calls 3

viewMethod · 0.95
is_emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected