-
Notifications
You must be signed in to change notification settings - Fork 3
Function proposal - split() #3
Copy link
Copy link
Open
Description
Given a string - split string on a pattern:
For example in Javascript one might implement it as follows:
registerFunction(
'split',
([splitChar, toSplit]) => {
return toSplit.split(splitChar);
},
[{ types: [TYPE_STRING] }, { types: [TYPE_STRING] }],
);Examples:
jmespath.search("foo-bar-baz", "split('-', @)")
// OUTPUTS: [ 'foo', 'bar', 'baz' ]
jmespath.search("foo-bar-baz", "split('*', @)")
// OUTPUTS: [ 'foo-bar-baz' ]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels