优化 CharSequenceUtil工具类 startWithAny()、startWithAnyIgnoreCase() 参数命名错误问题。

This commit is contained in:
konbai 2024-05-13 22:01:37 +08:00
parent 4dd0b15da7
commit 5ac1dbb42a

View File

@ -404,8 +404,8 @@ public class CharSequenceUtil extends StrValidator {
return false;
}
for (final CharSequence suffix : prefixes) {
if (startWith(str, suffix, false)) {
for (final CharSequence prefix : prefixes) {
if (startWith(str, prefix, false)) {
return true;
}
}
@ -417,17 +417,17 @@ public class CharSequenceUtil extends StrValidator {
* 给定字符串和数组为空都返回false
*
* @param str 给定字符串
* @param suffixes 需要检测的开始字符串
* @param prefixes 需要检测的开始字符串
* @return 给定字符串是否以任何一个字符串开始
* @since 6.0.0
*/
public static boolean startWithAnyIgnoreCase(final CharSequence str, final CharSequence... suffixes) {
if (isEmpty(str) || ArrayUtil.isEmpty(suffixes)) {
public static boolean startWithAnyIgnoreCase(final CharSequence str, final CharSequence... prefixes) {
if (isEmpty(str) || ArrayUtil.isEmpty(prefixes)) {
return false;
}
for (final CharSequence suffix : suffixes) {
if (startWith(str, suffix, true)) {
for (final CharSequence prefix : prefixes) {
if (startWith(str, prefix, true)) {
return true;
}
}