You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/4_secondary_admin_controls/expressions/functions.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,16 @@ There are various supported functions, and we are willing to add more. Let us kn
2
2
3
3
The currently supported functions are:
4
4
5
+
##### General operations
6
+
7
+
**length(val)**
8
+
9
+
Find the length of the item passed in.
10
+
* For a strings it will return the number of unicode graphemes
11
+
* For arrays, the number of elements
12
+
* For JSON or other objects, it will return the number of properties
13
+
* For numbers it will return the length of the string representation
14
+
5
15
##### Numeric operations
6
16
7
17
**round(val)**
@@ -71,11 +81,11 @@ Trims any whitespace at the beginning and end of the string.
71
81
72
82
**strlen(val)**
73
83
74
-
Find the length of the given string.
84
+
Find the length of the given string. For Unicode strings this will count the bytes not the graphemes.
75
85
76
86
**substr(val, indexStart, indexEnd)**
77
87
78
-
substr() extracts characters from indexStart up to but not including indexEnd.
88
+
substr() extracts characters from indexStart up to but not including indexEnd. For Unicode strings, this will count based on the bytes not the graphemes.
79
89
80
90
- If indexStart >= str.length, an empty string is returned.
81
91
- If indexStart < 0, the index is counted from the end of the string. More formally, in this case, the substring starts at max(indexStart + str.length, 0).
Find the index of the first occurrence of a value within the provided string.
119
+
Find the index of the first occurrence of a value within the provided string. For Unicode strings, this will count based on the bytes not the graphemes.
110
120
111
121
Optionally provide an offset to begin the search from, otherwise it starts from position 0 (the beginning).
112
122
113
123
If the value isn't found, it will return -1, otherwise the index of the first occurence.
114
124
115
125
**lastIndexOf(val, find, offset)**
116
126
117
-
Find the index of the last occurrence of a value within the provided string, searching from the end.
127
+
Find the index of the last occurrence of a value within the provided string, searching from the end. For Unicode strings, this will count based on the bytes not the graphemes.
118
128
119
129
Optionally provide an offset to begin the search from, searching from the end.
0 commit comments