llvm::StringRef::rfind

rfind overloads

Synopses

Declared in <llvm/ADT/StringRef.h>

Search for the last string Str in the string.

[[nodiscard]]
size_t
rfind(StringRef Str) const;
» more...

Search for the last character C in the string.

[[nodiscard]]
size_t
rfind(
    char C,
    size_t From = npos) const;
» more...

Return Value

  • The index of the last occurrence of Str, or npos if not found.
  • The index of the last occurrence of C, or npos if not found.

NOTE

The return value should not be discarded.

Parameters

NameDescription
StrSubstring to search for.
CCharacter to search for.
FromIndex to start the reverse search from.