Added Common::String::contains() method

svn-id: r26514
This commit is contained in:
Max Horn 2007-04-15 18:27:10 +00:00
parent 35b19cdcc8
commit aecd100f93
3 changed files with 16 additions and 2 deletions

View file

@ -211,6 +211,11 @@ bool String::hasSuffix(const char *x) const {
return *x == 0;
}
bool String::contains(const char *x) const {
assert(x != 0);
return strstr(c_str(), x) != NULL;
}
void String::deleteLastChar() {
deleteChar(_len - 1);
}