...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::algorithm::trim_right_copy — Right trim.
// In header: <boost/algorithm/string/trim.hpp> template<typename SequenceT> SequenceT trim_right_copy(const SequenceT & Input, const std::locale & Loc = std::locale());