klyn.String.substring
method

    public native substring(start as Int, length as Int = -1) as String throws IndexException

Description

Extracts a substring.

Parameters

- start Start index (negative values are relative to end).
- length Number of characters (default: until end).

Returns

Extracted substring.

Throws

- IndexException if bounds are invalid.

Example

    assert "café".substring(1, 2) == "af"