Fix a few string bugs add StartsWith for strings

This commit is contained in:
Tobias Loose
2013-11-29 10:56:33 +01:00
parent 9d5a83d588
commit 672b0be7bd
3 changed files with 44 additions and 18 deletions

View File

@@ -399,3 +399,13 @@ void ReplaceString(std::string& subject, const std::string& search, const std::s
}
}
bool StartsWith(const std::string& base, const char *start)
{
return base.compare(0, strlen(start), start) == 0;
}
bool StartsWith(const std::string& base, const std::string& start)
{
return base.compare(0, start.length(), start) == 0;
}