Return true if the string ends with the suffix. Note: The comparison is case sensitive.
| 90 | // Return true if the string ends with the suffix. |
| 91 | // Note: The comparison is case sensitive. |
| 92 | inline bool EndsWith(const std::string & str, const std::string & suffix) |
| 93 | { |
| 94 | return str.size() >= suffix.size() && |
| 95 | 0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix); |
| 96 | } |
| 97 | |
| 98 | // Return true if the string starts with the prefix. |
| 99 | // Note: The comparison is case sensitive. |