The substring() function returns a substring extracted from the given string, with the specified start zero-based index and continuing for the specified number of characters.
substring(str, start, length)
| Argument | Type | Description |
|---|---|---|
str | String | The string to extract substring from |
start | Integer ≥ 0 | The index where the substring begins |
length | Integer > 0 | The number of characters in the substring |
Return type: String
UQLreturn substring("a database", 2, 4)
Result: data
Extract the first 150 characters of the post content as a preview.
UQLfind().nodes({@post.title == "High Density Parallel Computing"}) as post return substring(post.content, 0, 150)