jmespath / jmespath/jmespath.jep
Function proposal - split()
Open
- Dominant language
- Python
- Stars
- 10
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Given a `string` - split string on a pattern:
For example in Javascript one might implement it as follows:
```javascript
registerFunction(
'split',
([splitChar, toSplit]) => {
return toSplit.split(splitChar);
},
[{ types: [TYPE_STRING] }, { types: [TYPE_STRING] }],
);
```
Examples:
```javascript
jmespath.search("foo-bar-baz", "split('-', @)")
// OUTPUTS: [ 'foo', 'bar', 'baz' ]
jmespath.search("foo-bar-baz", "split('*', @)")
// OUTPUTS: [ 'foo-bar-baz' ]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.