Added startsWith function

This commit is contained in:
Matt Hill
2014-05-18 12:49:56 -05:00
parent d2bee35fa9
commit 0751720d95
2 changed files with 10 additions and 0 deletions

View File

@@ -1,5 +1,14 @@
#include "filesystem.h"
bool startsWith(std::string const &fullString, std::string const &prefix)
{
if(fullString.substr(0, prefix.size()) == prefix) {
return true;
}
return false;
}
bool hasEnding (std::string const &fullString, std::string const &ending)
{
if (fullString.length() >= ending.length())