MCPcopy Create free account
hub / github.com/dengwirda/jigsaw / string

Method string

src/libcpp/textutil.hpp:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 */
54
55 __static_call
56 __inline_call std::string trim (
57 std::string const&_line
58 )
59 {
60 typename std::string::size_type _pos1 =
61 _line.find_first_not_of(" \n\r\t") ;
62
63 typename std::string::size_type _pos2 =
64 _line. find_last_not_of(" \n\r\t") ;
65
66 if (_pos1 != std::string::npos &&
67 _pos2 != std::string::npos )
68 {
69 return _line.substr(
70 _pos1, _pos2-_pos1 + 1 );
71 }
72 else
73 {
74 return ( std::string() ) ;
75 }
76 }
77
78 /*
79 --------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected