Skip to content

Commit d0c662d

Browse files
authored
Merge pull request #253 from rwtolbert/examples_string_47trimr
add examples for string/trimr
2 parents 7d1c1b3 + 138daa5 commit d0c662d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/string_47trimr.janet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# trim trailing/right side whitespace
2+
(string/trimr " foo ") # -> " foo"
3+
4+
# default whitespace includes " \t\r\n\v\f"
5+
(string/trimr "\t bar\n\r\f") # -> "\t bar"
6+
7+
# provide custom set of characters to trimr
8+
(string/trimr "_.foo_bar. \n" " ._\n") # -> "_.foo_bar"

0 commit comments

Comments
 (0)