Lines Matching defs:Suffix
276 /// Check if this string ends with the given \p Suffix.
277 [[nodiscard]] bool ends_with(StringRef Suffix) const {
278 return size() >= Suffix.size() &&
279 compareMemory(end() - Suffix.size(), Suffix.data(),
280 Suffix.size()) == 0;
282 [[nodiscard]] bool ends_with(char Suffix) const {
283 return !empty() && back() == Suffix;
286 /// Check if this string ends with the given \p Suffix, ignoring case.
287 [[nodiscard]] bool ends_with_insensitive(StringRef Suffix) const;
655 bool consume_back(StringRef Suffix) {
656 if (!ends_with(Suffix))
659 *this = substr(0, size() - Suffix.size());
665 bool consume_back_insensitive(StringRef Suffix) {
666 if (!ends_with_insensitive(Suffix))
669 *this = substr(0, size() - Suffix.size());