File indexing completed on 2025-01-18 09:52:46
0001 #ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
0002 #define BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
0003
0004
0005
0006
0007
0008 #include <string>
0009
0010 namespace boost
0011 {
0012 namespace thread_detail
0013 {
0014
0015 inline std::string string_trim( std::string const& s )
0016 {
0017 std::size_t i = s.find_first_not_of( " \t\r\n" );
0018
0019 if( i == std::string::npos ) return std::string();
0020
0021 std::size_t j = s.find_last_not_of( " \t\r\n" );
0022
0023 return s.substr( i, j + 1 - i );
0024 }
0025
0026 }
0027 }
0028
0029 #endif