summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/anope.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/anope.h b/include/anope.h
index 354c0bda5..28bc50512 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -159,24 +159,24 @@ namespace Anope
* Trim leading and trailing white spaces from the string.
*/
- inline string& ltrim()
+ inline string& ltrim(const Anope::string &what = " \t\r\n")
{
- while (!this->_string.empty() && isspace(this->_string[0]))
+ while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
this->_string.erase(this->_string.begin());
return *this;
}
- inline string& rtrim()
+ inline string& rtrim(const Anope::string &what = " \t\r\n")
{
- while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1]))
+ while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
this->_string.erase(this->_string.length() - 1);
return *this;
}
- inline string& trim()
+ inline string& trim(const Anope::string &what = " \t\r\n")
{
- this->ltrim();
- this->rtrim();
+ this->ltrim(what);
+ this->rtrim(what);
return *this;
}