1 //! \file StringUtils.cpp
3 #include "StringUtils.h"
7 bool StringUtils::startsWith(const std::string
& stringToTest
,
8 const std::string
& beginning
)
10 if(stringToTest
.empty() || beginning
.empty()) {
14 // can't be starting with beginning if it's shorter
15 if(stringToTest
.length() < beginning
.length()) {
19 // suffice to compare n characters, where n is length of beginning
20 return stringToTest
.substr(0, beginning
.length()) == beginning
;
22 } // namespace WikiWalker