llvm::StringRef::substr

Return a reference to the substring from [Start, Start + N).]

Synopsis

Declared in <llvm/ADT/StringRef.h>

[[nodiscard]]
constexpr
StringRef
substr(
    size_t Start,
    size_t N = npos) const;

Return Value

Substring covering at most N characters from Start.

NOTE

The return value should not be discarded.

Parameters

NameDescription
StartThe index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned.
NThe number of characters to included in the substring. If N exceeds the number of characters remaining in the string, the string suffix (starting with Start) will be returned.