start ...
This commit is contained in:
29
examples/str_exam.cpp
Normal file
29
examples/str_exam.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <print>
|
||||
// #include "../utils/snplib_string.h"
|
||||
// #include "../include/snipplib/snplib_string.h"
|
||||
#include <snipplib/utils/snplib_string.h>
|
||||
|
||||
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);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user