From e219df55ec94c40ec7aef78afd3f3e7e33e44154 Mon Sep 17 00:00:00 2001 From: Bob Tolbert Date: Tue, 14 Jan 2025 07:44:24 -0600 Subject: [PATCH] add examples for string/triml --- examples/string_47triml.janet | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 examples/string_47triml.janet diff --git a/examples/string_47triml.janet b/examples/string_47triml.janet new file mode 100644 index 0000000..4d1250c --- /dev/null +++ b/examples/string_47triml.janet @@ -0,0 +1,8 @@ +# trim leading/left side whitespace +(string/triml " foo ") # -> "foo " + +# default whitespace includes " \t\r\n\v\f" +(string/triml "\t bar\n\r\f") # -> "bar\n\r\f" + +# provide custom set of characters to triml +(string/triml "_.foo_bar. \n" " ._\n") # -> "foo_bar. \n" \ No newline at end of file