1
0
mirror of https://gitee.com/dromara/hutool.git synced 2025-04-05 17:37:59 +08:00

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

Merge pull request  from KonBAI/v5-dev
This commit is contained in:
Looly 2024-05-14 01:46:40 +00:00 committed by Gitee
commit ec3ac96fdf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -762,8 +762,8 @@ public class CharSequenceUtil {
return false;
}
for (CharSequence suffix : prefixes) {
if (startWith(str, suffix, false)) {
for (CharSequence prefix : prefixes) {
if (startWith(str, prefix, false)) {
return true;
}
}
@ -775,17 +775,17 @@ public class CharSequenceUtil {
* 给定字符串和数组为空都返回false
*
* @param str 给定字符串
* @param suffixes 需要检测的开始字符串
* @param prefixes 需要检测的开始字符串
* @return 给定字符串是否以任何一个字符串开始
* @since 5.8.1
*/
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;
}
}