llvm::StringRef::take_front

Return a StringRef equal to 'this' but with only the first N elements remaining. If N is greater than the length of the string, the entire string is returned.

Synopsis

Declared in <llvm/ADT/StringRef.h>

[[nodiscard]]
StringRef
take_front(size_t N = 1) const;

Return Value

Prefix of at most N characters.

NOTE

The return value should not be discarded.

Parameters

NameDescription
NNumber of characters to keep from the front.