llvm::StringRef::take_while

Return the longest prefix of 'this' such that every character in the prefix satisfies the given predicate.

Synopsis

Declared in <llvm/ADT/StringRef.h>

[[nodiscard]]
StringRef
take_while(function_ref<bool(char)> F) const;

Return Value

Longest prefix whose characters all satisfy F.

NOTE

The return value should not be discarded.

Parameters

NameDescription
FPredicate that identifies characters to keep from the front.