Java Utililty Methods String Match

List of utility methods to do String Match

  1. HOME
  2. Java
  3. S
  4. String Match

Description

The list of methods to do String Match are organized into topic(s).

Method

boolean regionMatches(boolean ignoreCase, CharSequence thisSeq, int toffset, CharSequence otherSeq, int ooffset, int len)
region Matches
int to = toffset;
int po = ooffset;
if ((ooffset < 0) || (toffset < 0) || (toffset > (long) thisSeq.length() - len)
 || (ooffset > (long) otherSeq.length() - len)) {
 return false;
while (len-- > 0) {
 char c1 = thisSeq.charAt(to++);
...
boolean regionMatches(byte[] ba1, int pos1, byte[] ba2, int pos2, int len)
Tests if two byte regions are equal.
int to = +pos1;
int po = pos2;
if ((pos2 < 0) || (pos1 < 0) || (pos1 > ((long) ba1.length - len)) || (pos2 > ((long) ba2.length - len))) {
 return false;
while (len-- > 0) {
 byte c1 = ba1[to++];
 byte c2 = ba2[po++];
...
boolean regionMatches(byte[] subValue, byte[] superValue, int offset)
Checks whether subValue matches the region in superValue starting at offset offset.
for (int i = 0; i < subValue.length; i++) {
 if (subValue[i] != superValue[i + offset]) {
 return false;
return true;
boolean regionMatches(char[] source, char[] target, int sIndex)
tIndex + sc.length <= tc.length .
if (source.length < sIndex + target.length)
 return false;
int i, len = target.length;
for (i = 0; i < len; i++) {
 if (source[sIndex + i] != target[i])
 return false;
return true;
...
boolean regionMatches(CharSequence a, int i, CharSequence b, int j, int len)
region Matches
if (i + len > a.length() || j + len > b.length() || i < 0 || j < 0 || len < 0) {
 return false;
while (len-- > 0) {
 if (a.charAt(i++) != b.charAt(j++)) {
 return false;
return true;
boolean regionMatches(CharSequence cs, boolean ignoreCase, int thisStart, CharSequence substring, int start, int length)
Green implementation of regionMatches.
if (cs instanceof String && substring instanceof String) {
 return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length);
} else {
 return cs.toString().regionMatches(ignoreCase, thisStart, substring.toString(), start, length);
boolean regionMatches(CharSequence cs, boolean ignoreCase, int thisStart, CharSequence substring, int start, int length)
region Matches
if (cs instanceof String && substring instanceof String) {
 return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length);
} else {
 return cs.toString().regionMatches(ignoreCase, thisStart, substring.toString(), start, length);
boolean regionMatches(CharSequence receiver, int thisOffset, String other, int otherOffset, int length, boolean ignoreCase)
region Matches
if (ignoreCase) {
 for (int i = 0; i < length; i++) {
 if (Character.toLowerCase(receiver.charAt(i + thisOffset)) != Character
 .toLowerCase(other.charAt(i + otherOffset)))
 return false;
} else {
 for (int i = 0; i < length; i++) {
...
boolean regionMatches(CharSequence seq, int toff, CharSequence other, int ooff, int len)
Implementation of String.regionMatches() for CharSequence.
if (toff < 0 || ooff < 0 || len < 0)
 return false;
boolean ret = true;
for (int i = 0; i < len; i++) {
 char c1;
 if (i + toff < seq.length())
 c1 = seq.charAt(i + toff);
 else {
...
boolean regionMatches(final char[] content, final int index, final String tag)
region Matches
final int length = tag.length();
for (int i = 0; i < length; i++) {
 if (content[i + index] != tag.charAt(i)) {
 return false;
return true;


AltStyle によって変換されたページ (->オリジナル) /