Skip to content

Commit e219df5

Browse files
committed
add examples for string/triml
1 parent 56f2acd commit e219df5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/string_47triml.janet

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

0 commit comments

Comments
 (0)