Returns true iff this String ends with the given suffix, ignoring case. Any String is considered to end with a NULL or empty suffix.
| 2980 | // Returns true iff this String ends with the given suffix, ignoring case. |
| 2981 | // Any String is considered to end with a NULL or empty suffix. |
| 2982 | bool String::EndsWithCaseInsensitive(const char* suffix) const { |
| 2983 | if (suffix == NULL || CStringEquals(suffix, "")) return true; |
| 2984 | |
| 2985 | if (c_str() == NULL) return false; |
| 2986 | |
| 2987 | const size_t this_len = strlen(c_str()); |
| 2988 | const size_t suffix_len = strlen(suffix); |
| 2989 | return (this_len >= suffix_len) && |
| 2990 | CaseInsensitiveCStringEquals(c_str() + this_len - suffix_len, suffix); |
| 2991 | } |
| 2992 | |
| 2993 | // Formats a list of arguments to a String, using the same format |
| 2994 | // spec string as for printf. |
no test coverage detected