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
- support negative start value (e.g. substr('hello',-2) returns 'lo')
- support negative length value (e.g. substr('hello',3,-1) returns 'll')
- length parameter now optional, defaults to end of string
(e.g. substr('hello world',7) returns 'world')
Copy file name to clipboardExpand all lines: resources/function_help/json/substr
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,15 @@
2
2
"name": "substr",
3
3
"type": "function",
4
4
"description": "Returns a part of a string.",
5
-
"arguments": [ {"arg":"input_string","description":"the full input string"},
6
-
{"arg":"startpos","description":"integer representing start position to extract from"},
7
-
{"arg":"length","description":"integer representing length of string to extract"}
5
+
"arguments": [ {"arg":"string","description":"the full input string"},
6
+
{"arg":"start","description":"integer representing start position to extract from; if start is negative, the return string will begin at the end of the string minus the start value"},
7
+
{"arg":"length","optional":true,"description":"integer representing length of string to extract; if length is negative, the return string will omit the given length of characters from the end of the string"}
0 commit comments