MCPcopy Create free account
hub / github.com/TadasBaltrusaitis/CLM-framework / rtrim

Function rtrim

lib/3rdParty/dlib/include/dlib/string/string.h:628–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626 typename alloc
627 >
628 const std::basic_string<charT,traits,alloc> rtrim (
629 const std::basic_string<charT,traits,alloc>& str,
630 const std::basic_string<charT,traits,alloc>& trim_chars
631 )
632 {
633 typedef std::basic_string<charT,traits,alloc> string;
634
635 typename string::size_type pos = str.find_last_not_of(trim_chars);
636 if (pos != string::npos)
637 return str.substr(0,pos+1);
638 else
639 return std::basic_string<charT,traits,alloc>();
640 }
641
642 template <
643 typename charT,

Callers 1

string_testFunction · 0.85

Calls 2

find_last_not_ofMethod · 0.80
substrMethod · 0.45

Tested by 1

string_testFunction · 0.68