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