BloombergLP::bdlb::StringViewUtil::substr

Return a string whose value is the substring starting at the optionally specified position in the specified string, of length the optionally specified numChars or length() - position, whichever is smaller. If position is not specified, 0 is used (i.e., the substring is from the beginning of this string). If numChars is not specified, k_NPOS is used (i.e., the entire suffix from position to the end of the string is returned). The behavior is undefined unless position is within the string boundaries (0 <= position <= string.length()).

Synopsis

Declared in <bdlb_stringviewutil.h>

static
std::string_view
substr(
    std::string_view const& string,
    size_type position = 0,
    size_type numChars = k_NPOS);