references/sleep-functions/right.md

GitHub

right

Category: Strings

Source: https://sleep.dashnine.org/manual/right.html


Synopsis

$ right("string", n)

Returns the right n characters of "string"

Parameters

"string" - the string to get the characters from.

n - number of characters to grab

Returns

A scalar string.

Examples

Example:

$string = "this is a test";
$right = right($string, 4);

println("Right chars are: $right");

Output:

Right chars are: test

See Also

&byteAt; &charAt; &left; ∣ &strlen; &substr