Fix rtrimstr("") always output "" (#3415)
Example
---
**Before this fix**:
```sh
$ jq -n '"foo"|rtrimstr("")'
""
```
**After this fix**:
```sh
$ jq -n '"foo"|rtrimstr("")'
"foo"
```
This commit is contained in:
1 parent
c8017bf079
commit
169457328d
2 files changed
+13
-1
No files matched your search
@@ -1512,6 +1512,18 @@ split("")
|
||||
["fo", "foo", "barfoo", "foobarfoo", "foob"]
|
||||
["fo","","bar","bar","b"]
|
||||
|
||||
[.[]|ltrimstr("")]
|
||||
["a", "xx", ""]
|
||||
["a", "xx", ""]
|
||||
|
||||
[.[]|rtrimstr("")]
|
||||
["a", "xx", ""]
|
||||
["a", "xx", ""]
|
||||
|
||||
[.[]|trimstr("")]
|
||||
["a", "xx", ""]
|
||||
["a", "xx", ""]
|
||||
|
||||
[(index(","), rindex(",")), indices(",")]
|
||||
"a,bc,def,ghij,klmno"
|
||||
[1,13,[1,4,8,13]]
|
||||
|
||||
Reference in new issue
Block a user