summaryrefslogtreecommitdiff
path: root/src/str.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-10-19 00:06:54 +0200
committerJoel Klinghed <the_jk@spawned.biz>2025-10-19 00:13:47 +0200
commit800bdbb18617dfac36067b8841781a92b19d57c1 (patch)
tree2b003e2273eb2f20e31b69ae8b6120bfc2062873 /src/str.hh
parentdad0aaa9b33a5a217ac115334a94fe299dce9e08 (diff)
str: Add ltrim and rtrim
Useful when you only want to trim one side..
Diffstat (limited to 'src/str.hh')
-rw-r--r--src/str.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/str.hh b/src/str.hh
index 1c618ee..c736f4b 100644
--- a/src/str.hh
+++ b/src/str.hh
@@ -23,6 +23,12 @@ void split(std::string_view str, std::vector<std::string_view>& out,
[[nodiscard]]
std::string_view trim(std::string_view str);
+[[nodiscard]]
+std::string_view ltrim(std::string_view str);
+
+[[nodiscard]]
+std::string_view rtrim(std::string_view str);
+
} // namespace str
#endif // STR_HH