• Returns a substring of the string starting from the right.

    strRight() extracts the number of characters from right of the string up to the count. In particular:

    • If count is less than zero, strRight() returns an empty string.
    • If count is less than value.length', strRight() returns a new string with the count` number of characters from the right of the string.
    • If count is greater than value.length, then the value original value is returned.

    Any argument value that is NaN is treated as if it were 0.

    Parameters

    • value: string

      The string value to return the substring from.

    • count: number

      The number of characters to extract

    Returns string

    The substring based on the count number of characters from the right

    Since

    0.4.2

    Example

    strRight("Nevware21", -1); // ""
    strRight("Nevware21", 0); // ""
    strRight("Nevware21", 1); // "1"
    strRight("Nevware21", 3); // "e21"
    strRight("Nevware21", 21); // "Nevware21"