commit c49d12ecdb15a8bf968cc04eb2c68aa9ab96f943
parent b77dee892061c577d4fc75c0ddd12a0d8c7d8150
Author: Robert Russell <robertrussell.72001@gmail.com>
Date: Wed, 14 Jun 2023 13:38:19 -0700
Add str_slice_to_end
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/inc/string.h b/inc/string.h
@@ -72,6 +72,11 @@ int str_alloc_vprintf(Str *str, char *fmt, va_list args);
Str str_slice(Str s, isize l, isize u);
+static inline Str
+str_slice_to_end(Str s, isize l) {
+ return str_slice(s, l, str_len(s));
+}
+
char *str_alloc_cstr(Str s);
static inline usize