Oihana PHP Arango

right.php

Table of Contents

Functions

right()  : string
Return the rightmost characters of a string.

Functions

right()

Return the rightmost characters of a string.

right(string $value, int $length) : string

This helper wraps the ArangoDB AQL function RIGHT(value, length) which returns the specified number of characters from the right (end) of the string.

Example AQL usage:

RIGHT("hello world", 5)       // returns "world"
RIGHT("hello world", 0)       // returns ""
RIGHT("hello world", 20)      // returns "hello world" (entire string)
RIGHT(doc.title, 10)          // returns last 10 characters of title
Parameters
$value : string

String expression to extract characters from.

$length : int

Number of characters to return from the right.

Tags
example
use function oihana\arango\db\functions\strings\right;

$expr = right('doc.title', 10);
// Produces: 'RIGHT(doc.title, 10)'
see
https://docs.arangodb.com/stable/aql/functions/string/#right
left()

For extracting characters from the left.

subString()

For extracting characters from any position.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results