Android Guides | Samples

Java.Lang.String.RegionMatches Method

Returns true if the given subsequence of the given string matches this string starting at the given offset.

Syntax

[Android.Runtime.Register("regionMatches", "(ZILjava/lang/String;II)Z", "")]
public Boolean RegionMatches (Boolean ignoreCase, Int32 thisStart, String string, Int32 start, Int32 length)

Parameters

ignoreCase
specifies if case should be ignored (use Collator instead for non-ASCII case insensitivity).
thisStart
the start offset in this string.
string
the other string.
start
the start offset in string.
length
the number of chars to compare.

Exceptions

TypeReason
NullPointerExceptionif string is null.

Remarks

Returns true if the given subsequence of the given string matches this string starting at the given offset.

If ignoreCase is true, case is ignored during the comparison. The strings are compared one char at a time. This is not suitable for case-insensitive string comparison for all locales. Use a Collator instead.

[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