diff --git a/include/fc/string.hpp b/include/fc/string.hpp index 5a53cd9..5afeb9f 100644 --- a/include/fc/string.hpp +++ b/include/fc/string.hpp @@ -19,6 +19,7 @@ namespace fc typedef fc::optional ostring; class variant_object; fc::string format_string( const fc::string&, const variant_object& ); + fc::string trim( const fc::string& ); } #else diff --git a/src/string.cpp b/src/string.cpp index be55ca6..ce79a9c 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include @@ -97,7 +98,12 @@ namespace fc { { return boost::lexical_cast(d); } - + std::string trim( const std::string& s ) + { + std::string cpy(s); + boost::algorithm::trim(cpy); + return cpy; + } } // namespace fc