BloombergLP::bdlb::IndexSpanStringUtil::createFromPositions

Return an IndexSpan for the half-open range [begin, end) in] string.

Synopsis

Declared in <bdlb_indexspanstringutil.h>

static
IndexSpan
createFromPositions(
    std::string_view const& string,
    IndexSpan::size_type begin,
    IndexSpan::size_type end);

Description

Return an IndexSpan describing the substring of the specified string starting at the specified begin and ending (not including) the specified end. The behavior is undefined unless begin <= string.length() and end <= string.length().

Return Value

an IndexSpan describing the half-open range [begin, end)]

Parameters

NameDescription
stringstring containing the substring
beginstarting position of the substring
endone-past-the-end position of the substring