public class StrRegionMatcher extends Object implements BiPredicate<CharSequence,CharSequence>, Serializable
a b c d e f
| | | |
0 1 c d -2 -1
例如以下匹配都为true:
offset str strToCheck
0 abcdef ab
1 abcdef bc
-1 abcdef ef
-2 abcdef de
| Constructor and Description |
|---|
StrRegionMatcher(boolean ignoreCase,
boolean ignoreEquals,
boolean isPrefix)
构造
|
StrRegionMatcher(boolean ignoreCase,
boolean ignoreEquals,
int offset)
构造
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
test(CharSequence str,
CharSequence strToCheck) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitand, negate, orpublic StrRegionMatcher(boolean ignoreCase,
boolean ignoreEquals,
boolean isPrefix)
ignoreCase - 是否忽略大小写ignoreEquals - 是否忽略字符串相等的情况isPrefix - true表示检查开头匹配,false检查末尾匹配public StrRegionMatcher(boolean ignoreCase,
boolean ignoreEquals,
int offset)
ignoreCase - 是否忽略大小写ignoreEquals - 是否忽略字符串相等的情况offset - 匹配位置,正数表示从开始偏移,负数表示从后偏移public boolean test(CharSequence str, CharSequence strToCheck)
test in interface BiPredicate<CharSequence,CharSequence>Copyright © 2025. All rights reserved.