1234567891011121314151617181920212223242526272829 |
- #ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
- #define BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
- #include <string>
- namespace boost
- {
- namespace thread_detail
- {
- inline std::string string_trim( std::string const& s )
- {
- std::size_t i = s.find_first_not_of( " \t\r\n" );
- if( i == std::string::npos ) return std::string();
- std::size_t j = s.find_last_not_of( " \t\r\n" );
- return s.substr( i, j + 1 - i );
- }
- }
- }
- #endif
|