8#ifndef SkStringView_DEFINED
9#define SkStringView_DEFINED
18 if (
prefix.length() > str.length()) {
24inline constexpr bool starts_with(std::string_view str, std::string_view::value_type c) {
25 return !str.empty() && str.front() == c;
29 if (
suffix.length() > str.length()) {
32 return suffix.length() == 0 || !memcmp(str.data() + str.length() -
suffix.length(),
36inline constexpr bool ends_with(std::string_view str, std::string_view::value_type c) {
37 return !str.empty() && str.back() == c;
41inline constexpr bool contains(std::string_view str, std::string_view needle) {
42 return str.find(needle) != std::string_view::npos;
45inline constexpr bool contains(std::string_view str, std::string_view::value_type c) {
46 return str.find(c) != std::string_view::npos;
constexpr bool starts_with(std::string_view str, std::string_view prefix)
constexpr bool ends_with(std::string_view str, std::string_view suffix)
constexpr bool contains(std::string_view str, std::string_view needle)