9 #ifndef litesql_string_hpp
10 #define litesql_string_hpp
21 std::ostringstream ost;
27 bool startsWith(
const std::string& what,
const std::string& with);
29 bool endsWith(
const std::string& what,
const std::string& with);
31 std::string
toLower(
const std::string& s);
33 std::string
toUpper(
const std::string& s);
35 std::string capitalize(
const std::string& s);
36 std::string decapitalize(
const std::string& s);
44 std::string
replace(
const std::string& s,
const std::string& what,
const std::string& with);
48 int atoi(
const std::string &s);
50 std::string
operator*(
int amount,
const std::string &s);
52 std::string
operator*(
const std::string &s,
int amount);
58 std::vector<std::string>
split(
const std::string& s,
const std::string& delim=
" ");
61 std::string
join(
const std::vector<std::string>& strings,
const std::string& delim=
" ");
68 std::vector<std::string>
slice(
const std::vector<std::string>& strings,
int start,
int end);
std::string lstrip(std::string s)
returns a string with no empty characters at the beginning of the string
std::string rstrip(std::string s)
returns a string with no empty characters at the end of the string
std::string replace(const std::string &s, const std::string &what, const std::string &with)
returns a copy string 's' where 'what' is replaced with 'with'
std::string toString(T a)
returns string representation of passed parameter if it can be written to ostringstream
Definition: string.hpp:20
int hexToInt(const std::string &s)
converts string representation of a hex number to integer
std::string toLower(const std::string &s)
returns lower-case version of the string
int atoi(const std::string &s)
string version of atoi
bool endsWith(const std::string &what, const std::string &with)
returns true if 'what' end with 'with'
std::string operator*(int amount, const std::string &s)
returns a string which is duplicated 'amount' times
Definition: string.cpp:93
std::string escapeSQL(const std::string &str)
escapes ' characters so that they do not break SQL statements.
std::vector< std::string > split(const std::string &s, const std::string &delim=" ")
from string.
std::string toUpper(const std::string &s)
returns upper-case version of the string
bool startsWith(const std::string &what, const std::string &with)
returns true if 'what' starts with 'with'
std::string join(const std::vector< std::string > &strings, const std::string &delim=" ")
returns strings joined with delimiter
std::vector< std::string > slice(const std::vector< std::string > &strings, int start, int end)
returns a part of strings
Definition: string.cpp:144