diff options
author | Greg Falcon <gfalcon@google.com> | 2023-03-15 14:41:08 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-03-15 14:41:46 -0700 |
commit | ab0e3e8e1fe0d71c2675b9e8c5aa48f19a1f716a (patch) | |
tree | cc626bc95cc23664449900d5023b0fd2e0e2ac14 /absl/strings/match.h | |
parent | a8f3b9d6119e8ff1e56a67661cf5a94f41c7866e (diff) | |
download | abseil-ab0e3e8e1fe0d71c2675b9e8c5aa48f19a1f716a.tar.gz abseil-ab0e3e8e1fe0d71c2675b9e8c5aa48f19a1f716a.tar.bz2 abseil-ab0e3e8e1fe0d71c2675b9e8c5aa48f19a1f716a.zip |
Add StrContainsIgnoreCase() to strings/match.h; all the other case-sensitive methods in this file have corresponding case-insensitive ones.
PiperOrigin-RevId: 516933773
Change-Id: Iaec41afd923b10bc493ad864c0ecfe85a1fe2db8
Diffstat (limited to 'absl/strings/match.h')
-rw-r--r-- | absl/strings/match.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/absl/strings/match.h b/absl/strings/match.h index 038cbb3f..1dc0beaf 100644 --- a/absl/strings/match.h +++ b/absl/strings/match.h @@ -72,6 +72,15 @@ inline bool EndsWith(absl::string_view text, memcmp(text.data() + (text.size() - suffix.size()), suffix.data(), suffix.size()) == 0); } +// StrContainsIgnoreCase() +// +// Returns whether a given ASCII string `haystack` contains the ASCII substring +// `needle`, ignoring case in the comparison. +bool StrContainsIgnoreCase(absl::string_view haystack, + absl::string_view needle) noexcept; + +bool StrContainsIgnoreCase(absl::string_view haystack, + char needle) noexcept; // EqualsIgnoreCase() // |