Skip to content

Commit 901e10d

Browse files
committed
feat: string oprations with executor "str"
1 parent 528f8d4 commit 901e10d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

LANGUAGE.md

+19
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,25 @@ Defined operations:
411411
| not |"$!" |negates boolean value|
412412

413413

414+
## String operations
415+
416+
Predefined executor `str` defines methods for string operations:
417+
418+
```json
419+
{ "$$str.concat": [ "a", "b", "c" ] }
420+
```
421+
422+
Defined operations:
423+
424+
| method |arguments|evaluation|
425+
|---------|---------|----------|
426+
| concat |[s1, s2, ...] |concatenate all arguments (must be strings)|
427+
| slice |[s, begin, end]|get substring of string `s` from index `begin` until index `end` (not included), omitted end means until the end of string, negative index - count from the end|
428+
| pos |[s1, s2]|position of string `s2` in string `s1`|
429+
| lower |s|convert string to lower case|
430+
| upper |s|convert string to upper case|
431+
432+
414433
## Array iteration
415434

416435
Predefined executor `array` implements methods for array iteration:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonscript",
3-
"version": "0.4.2",
3+
"version": "0.5.0",
44
"description": "Platform independent asynchronous and concurrent scripting language using JSON format",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)