Internals: Add VString::startsWith predicate function

This commit is contained in:
Geza Lore
2021-07-20 14:29:43 +01:00
parent a9c4a96c0f
commit d9c893af11
4 changed files with 16 additions and 12 deletions
+4
View File
@@ -174,6 +174,10 @@ string VString::replaceWord(const string& str, const string& from, const string&
return result;
}
bool VString::startsWith(const string& str, const string& prefix) {
return str.rfind(prefix, 0) == 0; // Faster than .find(_) == 0
}
//######################################################################
// VHashSha256