subString.php
Table of Contents
Functions
- subString() : string
- Return a substring of a string.
Functions
subString()
Return a substring of a string.
subString(string $value, int $offset[, int|null $length = null ]) : string
This helper wraps the ArangoDB AQL function SUBSTRING(value, offset, length)
which extracts a substring from the given string starting at the specified
offset with the optional length. Negative offsets start from the end of the string.
Example AQL usage:
SUBSTRING("hello world", 0, 5) // returns "hello"
SUBSTRING("hello world", 6) // returns "world"
SUBSTRING("hello world", -5) // returns "world" (from end)
SUBSTRING("hello world", 0, 3) // returns "hel"
Parameters
- $value : string
-
String expression to extract substring from.
- $offset : int
-
Starting position (0-based, negative values start from end).
- $length : int|null = null
-
Optional length of substring (default: to end of string).
Tags
Return values
string —The formatted AQL expression.