Android Guides | Samples

Java.Lang.String.LastIndexOf Method

Returns the index of the start of the previous match for the given string in this string, or -1.

Syntax

[Android.Runtime.Register("lastIndexOf", "(Ljava/lang/String;I)I", "")]
public Int32 LastIndexOf (String subString, Int32 start)

Parameters

subString
the string to find.
start
the starting offset.

Exceptions

TypeReason
NullPointerExceptionif subString is null.

Remarks

Returns the index of the start of the previous match for the given string in this string, or -1. The search for the string starts at the given index and moves towards the beginning of this string.

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1