String.regionMatches()

Signature

boolean regionMatches (boolean ignoreCase, String s1, int offset1, String s2, int offset2, int length)

Domain

action, condition

Description

Tests if two identified string regions are equal.

Parameters

NameTypeDescription
ignoreCasebooleanif true, ignore case when comparing characters.
s1StringA String to test for region matches.
offset1intThe starting offset of the subregion in the String s1.
s2StringSecond String to test for region matches.
offset2intThe starting offset of the subregion in the string s2.
lengthintThe number of characters to compare.

Returns

TypeDescription
booleantrue if the specified subregion of string s1 matches the specified subregion of the string s2; false otherwise. Whether the matching is exact or case insensitive depends on the ignoreCase argument.

Cautions

none

See Also

java.lang.String#regionMatches