MCPcopy Create free account
hub / github.com/davisking/dlib / trim

Function trim

dlib/string/string.h:654–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652 typename alloc
653 >
654 const std::basic_string<charT,traits,alloc> trim (
655 const std::basic_string<charT,traits,alloc>& str,
656 const std::basic_string<charT,traits,alloc>& trim_chars
657 )
658 {
659 typedef std::basic_string<charT,traits,alloc> string;
660 typename string::size_type lpos = str.find_first_not_of(trim_chars);
661 if (lpos != string::npos)
662 {
663 typename string::size_type rpos = str.find_last_not_of(trim_chars);
664 return str.substr(lpos,rpos-lpos+1);
665 }
666 else
667 {
668 return std::basic_string<charT,traits,alloc>();
669 }
670 }
671
672 template <
673 typename charT,

Callers 15

charactersMethod · 0.85
on_image_clickedMethod · 0.85
segmenter_params__str__Function · 0.85
matrix_double__repr__Function · 0.85
matrix_double__str__Function · 0.85
mat_row__repr__Function · 0.85
format_commentFunction · 0.85
grab_urlMethod · 0.85
string_testFunction · 0.85
charactersMethod · 0.85
parse_glyphMethod · 0.85

Calls

no outgoing calls

Tested by 1

string_testFunction · 0.68