From 37375d7bb878b280632cccc685c0179bb6d685e6 Mon Sep 17 00:00:00 2001 From: konbai <1527468660@qq.com> Date: Mon, 13 May 2024 21:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20CharSequenceUtil=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=20startWithAny()=E3=80=81startWithAnyIgnoreC?= =?UTF-8?q?ase()=20=E5=8F=82=E6=95=B0=E5=91=BD=E5=90=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/hutool/core/text/CharSequenceUtil.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java b/hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java index aad6557ec..4f7dc2bf1 100755 --- a/hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java @@ -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; } }