#include // #include "../utils/snplib_string.h" // #include "../include/snipplib/snplib_string.h" #include using namespace snplib; int main() { std::string si = " dewf wek e lwekjflkj "; auto s = snplib_trim_spaces(si); std::println("s = '{}'", s); auto sv = snplib_trim_spaces_as_view(si, TrimType::TRIM_LEFT); std::println("sv(TrimType::TRIM_LEFT) = '{}'", sv); sv = snplib_trim_spaces_as_view(si, TrimType::TRIM_RIGHT); std::println("sv(TrimType::TRIM_RIGHT) = '{}'", sv); sv = snplib_trim_spaces_as_view(si, TrimType::TRIM_BOTH); std::println("sv(TrimType::TRIM_BOTH) = '{}'", sv); si = "123; we; d34534; "; std::vector rv; rv = snplib_split_char_range(si, "; "); std::println("\n\nstr = '{}'", si); std::println("all elems: "); for (auto& el : rv) { std::println("el = '{}'", el); } rv = snplib_split_char_range(si, "; ", 1, 2); std::println("2 elems starting from 1: "); for (auto& el : rv) { std::println("el = '{}'", el); } return 0; }