Commit 5fae4d7d authored by Robert Menzel's avatar Robert Menzel

added string-starts-with method for a single char (it's faster in that case)

parent 7fea63ce
......@@ -25,6 +25,7 @@ namespace StringOperations
bool splitFileExtension (const std::string& _full, std::string& _file, std::string& _extension );
bool splitLastFileOrFolder (const std::string& _full, std::string& _path, std::string& _fileOrFolder);
bool startsWith (const std::string& _string, const std::string& _prefix);
bool startsWith (const std::string& _string, const char& _prefix);
std::vector<std::string> split (const std::string& _string, char _splitChar, bool _skipEmptyStrings = true);
......
......@@ -46,6 +46,17 @@ namespace StringOperations
return true;
}
bool startsWith(const std::string& _string, const char& _prefix)
{
if(_string.length() == 0)
return false;
if(_string[0] == _prefix)
return true;
return false;
}
std::vector<std::string> split(const std::string& _string, char _splitChar, bool _skipEmptyStrings)
{
std::vector<std::string> stringList;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment