bool endsWith(const LITESQL_String& what, const LITESQL_String& with) { if (what.size() < with.size()) return false; if (what.substr(what.size()-with.size(), what.size()) == with) return true; return false; }
bool startsWith(const LITESQL_String& what, const LITESQL_String& with) { if (what.size() < with.size()) return false; if (what.substr(0, with.size()) == with) return true; return false; }
LITESQL_String lstrip(const LITESQL_String& s) { unsigned int pos = 0; while (1) { if (isspace(s[pos]) && pos < s.size()-1) pos++; else break; } return s.substr(pos, s.size()); }
LITESQL_String rstrip(const LITESQL_String& s) { if (s.empty()) return s; int pos = s.size()-1; while (1) { if (isspace(s[pos]) && pos > 0) pos--; else break; } return s.substr(0, pos+1); }
LITESQL_String decapitalize(const LITESQL_String& s) { if (s.empty()) return s; LITESQL_Char buf[2] = {tolower(s[0]), 0}; return LITESQL_String(buf) + s.substr(1, s.size()); }