klyn.String.lastIndexOf
method
public native lastIndexOf(value as String, start as Int = -1) as Int
Description

Finds the last index of a substring up to a position.

Parameters
  • value Substring to find.
  • start Start index from the left limit (default: end of string).
Returns

Index of last occurrence, or -1 if not found.

Example
assert "banana".lastIndexOf("na") == 4