MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / partition_

Method partition_

include/stringzilla/stringzilla.hpp:2617–2622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2615
2616 template <typename pattern_>
2617 partition_type partition_(pattern_ &&pattern, std::size_t pattern_length) const noexcept {
2618 size_type pos = find(pattern);
2619 if (pos == npos) return {string_slice(*this), string_slice(), string_slice()};
2620 return {string_slice(start_, pos), string_slice(start_ + pos, pattern_length),
2621 string_slice(start_ + pos + pattern_length, length_ - pos - pattern_length)};
2622 }
2623
2624 template <typename pattern_>
2625 partition_type rpartition_(pattern_ &&pattern, std::size_t pattern_length) const noexcept {

Callers

nothing calls this directly

Calls 1

findFunction · 0.85

Tested by

no test coverage detected