Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/auxiliary/functions.cc')
-rw-r--r--src/auxiliary/functions.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/auxiliary/functions.cc b/src/auxiliary/functions.cc
index e9861ac..5edff56 100644
--- a/src/auxiliary/functions.cc
+++ b/src/auxiliary/functions.cc
@@ -122,4 +122,14 @@ const std::string lowercase(const std::string &text)
return t;
}
+void trim(std::string &text)
+{
+ while (text.size() && text[0] == ' ') {
+ text.erase(0, 1);
+ }
+ while (text.size() && text[text.size()-1] == ' ') {
+ text.erase(text.size()-1, 1);
+ }
+}
+
}