mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Move StringUtil.startsWithIgnoreCase to StringUtilRt
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.util.text;
|
||||
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -218,4 +219,11 @@ public class StringUtilRt {
|
||||
public static boolean endsWithChar(@Nullable CharSequence s, char suffix) {
|
||||
return s != null && s.length() != 0 && s.charAt(s.length() - 1) == suffix;
|
||||
}
|
||||
|
||||
public static boolean startsWithIgnoreCase(@NonNls @NotNull String str, @NonNls @NotNull String prefix) {
|
||||
final int stringLength = str.length();
|
||||
final int prefixLength = prefix.length();
|
||||
return stringLength >= prefixLength && str.regionMatches(true, 0, prefix, 0, prefixLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -238,9 +238,7 @@ public class StringUtil extends StringUtilRt {
|
||||
}
|
||||
|
||||
public static boolean startsWithIgnoreCase(@NonNls @NotNull String str, @NonNls @NotNull String prefix) {
|
||||
final int stringLength = str.length();
|
||||
final int prefixLength = prefix.length();
|
||||
return stringLength >= prefixLength && str.regionMatches(true, 0, prefix, 0, prefixLength);
|
||||
return StringUtilRt.startsWithIgnoreCase(str, prefix);
|
||||
}
|
||||
|
||||
public static String stripHtml(@NotNull String html, boolean convertBreaks) {
|
||||
|
||||
Reference in New Issue
Block a user