diff --git a/examples/string_47trim.janet b/examples/string_47trim.janet new file mode 100644 index 0000000..60d27b2 --- /dev/null +++ b/examples/string_47trim.janet @@ -0,0 +1,8 @@ +# trim leading and trailing whitespace +(string/trim " foo ") # -> "foo" + +# default whitespace includes " \t\r\n\v\f" +(string/trim "\t bar\n\r\f") # -> "bar" + +# provide custom set of characters to trim +(string/trim "_.foo_bar. \n" " ._\n") # -> "foo_bar" \ No newline at end of file