| 157 | } |
| 158 | |
| 159 | bool String::contains(const std::string &str, const std::string &substring, bool sensitive) |
| 160 | { |
| 161 | if (str.length() < substring.length()) |
| 162 | return false; |
| 163 | if (sensitive) |
| 164 | { |
| 165 | return str.find(substring) != std::string::npos; |
| 166 | } |
| 167 | auto it = std::search(str.begin(), str.end(), substring.begin(), substring.end(), charEqualsIgnoreCase); |
| 168 | return it != str.end(); |
| 169 | } |
| 170 | |
| 171 | bool String::endsWith(const std::string &str, const std::string &suffix, bool sensitive) |
| 172 | { |