right (JavaScript)

Gets a substring starting at the right.

Defined in

String (Standard - JavaScript)

Syntax

right(count:int) : string
Parameters Description
count The number of characters to get.
Return value Description
string The substring.

Usage

This method gets the number of characters specified by the parameter starting at the last index and working backwards.

Examples

The following example returns Tokyo.
var cities = new String("Paris   Moscow   Tokyo");
cities.right(5)