From c87f9627efc8b612eb9b000acfcc6731cad15765 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 7 Oct 2025 09:12:22 +0200 Subject: Initial commit --- src/str.hh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/str.hh (limited to 'src/str.hh') diff --git a/src/str.hh b/src/str.hh new file mode 100644 index 0000000..e1ee549 --- /dev/null +++ b/src/str.hh @@ -0,0 +1,21 @@ +#ifndef STR_HH +#define STR_HH + +#include +#include + +namespace str { + +void split(std::string_view str, std::vector& out, + char separator = ' ', bool keep_empty = false); + +[[nodiscard]] std::vector split(std::string_view str, + char separator = ' ', + bool keep_empty = false); + +[[nodiscard]] +std::string_view trim(std::string_view str); + +} // namespace str + +#endif // STR_HH -- cgit v1.2.3-70-g09d2