| 1018 | } |
| 1019 | |
| 1020 | std::string String::trim( const std::string& str, char character ) { |
| 1021 | std::string::size_type pos1 = str.find_first_not_of( character ); |
| 1022 | std::string::size_type pos2 = str.find_last_not_of( character ); |
| 1023 | return str.substr( pos1 == std::string::npos ? 0 : pos1, |
| 1024 | pos2 == std::string::npos ? str.length() - 1 : pos2 - pos1 + 1 ); |
| 1025 | } |
| 1026 | |
| 1027 | std::string_view String::lTrim( const std::string_view& str, char character ) { |
| 1028 | std::string::size_type pos1 = str.find_first_not_of( character ); |
no test coverage detected