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

Method sub

include/stringzilla/stringzilla.hpp:2989–2991  ·  view source on GitHub ↗

* @brief Equivalent to Python's `"abc"[-3:-1]`. Exception-safe, unlike STL's `substr`. * Supports signed and unsigned intervals. @b Doesn't copy or allocate memory! */

Source from the content-addressed store, hash-verified

2987 * Supports signed and unsigned intervals. @b Doesn't copy or allocate memory!
2988 */
2989 string_view sub(difference_type start, difference_type end = npos) const noexcept sz_lifetime_bound_ {
2990 return view().sub(start, end);
2991 }
2992 string_span sub(difference_type start, difference_type end = npos) noexcept sz_lifetime_bound_ {
2993 return span().sub(start, end);
2994 }

Callers 1

Calls 1

spanClass · 0.85

Tested by 1