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