summaryrefslogtreecommitdiff
path: root/tools/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/utils.c')
-rw-r--r--tools/utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/utils.c b/tools/utils.c
index 3ec6e4c..aecbfda 100644
--- a/tools/utils.c
+++ b/tools/utils.c
@@ -42,3 +42,19 @@ using namespace std;
foo << setw(didsome?2:1) << setfill('0') << sec;
return foo.str();
}
+
+std::string toLower(const std::string a){
+ std::string rslt = a;
+ std::string::iterator rr;
+ for (rr = rslt.begin(); rr != rslt.end(); rr++){
+ *rr = tolower(*rr);
+ }
+ return rslt;
+}
+
+////////////////
+std::string ltrim(const std::string foo){
+ size_t where = foo.find_first_not_of(" \t\r\n");
+ if (where == foo.npos) return foo;
+ return foo.substr(where);
+}