File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1417,6 +1417,8 @@ inline bool toBoolean(const ::std::string& s) { return s=="true"||s=="1"
14171417inline int toInt (const ::std::string& s) { return ::std::stoi (s); }
14181418inline float toFloat (const ::std::string& s) { try { return ::std::stof (s); } catch (...) { return 0 .0f ; } }
14191419inline char toChar (int v) { return static_cast <char >(v); }
1420+ inline ::std::string toUpperCase (::std::string s) { for (auto & c:s) c=::std::toupper ((unsigned char )c); return s; }
1421+ inline ::std::string toLowerCase (::std::string s) { for (auto & c:s) c=::std::tolower ((unsigned char )c); return s; }
14201422inline ::std::string trim (const ::std::string& s) {
14211423 size_t a=s.find_first_not_of (" \t\n\r " ), b=s.find_last_not_of (" \t\n\r " );
14221424 return a==::std::string::npos ? " " : s.substr (a, b-a+1 );
You can’t perform that action at this time.
0 commit comments