Add trimstr/1 function (#3319)
This commit is contained in:
1 parent
de21386681
commit
7d8c096e48
5 files changed
+35
No files matched your search
@@ -1798,6 +1798,17 @@ sections:
|
||||
input: '["fo", "foo", "barfoo", "foobar", "foob"]'
|
||||
output: ['["fo","","bar","foobar","foob"]']
|
||||
|
||||
- title: "`trimstr(str)`"
|
||||
body: |
|
||||
|
||||
Outputs its input with the given string removed at both ends, if it
|
||||
starts or ends with it.
|
||||
|
||||
examples:
|
||||
- program: '[.[]|trimstr("foo")]'
|
||||
input: '["fo", "foo", "barfoo", "foobarfoo", "foob"]'
|
||||
output: ['["fo","","bar","bar","b"]']
|
||||
|
||||
- title: "`trim`, `ltrim`, `rtrim`"
|
||||
body: |
|
||||
|
||||
|
||||
Reference in new issue
Block a user