java.lang.Object
com.intellij.openapi.util.text.StringUtilRt
- 直接已知子类:
StringUtil
Stripped-down version of
StringUtil.
Intended to use by external (out-of-IDE-process) runners and helpers so it should not contain any library dependencies.-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static booleancharsEqualIgnoreCase(char a, char b) static @NotNull CharSequenceconvertLineSeparators(@NotNull CharSequence text, @NotNull String newSeparator) static @NotNull StringconvertLineSeparators(@NotNull String text) Converts line separators to"\n"static @NotNull StringconvertLineSeparators(@NotNull String text, boolean keepCarriageReturn) static @NotNull StringconvertLineSeparators(@NotNull String text, @NotNull String newSeparator) static @NotNull StringconvertLineSeparators(@NotNull String text, @NotNull String newSeparator, @org.jetbrains.annotations.Nullable int[] offsetsToKeep) static @NotNull StringconvertLineSeparators(@NotNull String text, @NotNull String newSeparator, @org.jetbrains.annotations.Nullable int[] offsetsToKeep, boolean keepCarriageReturn) static booleanendsWith(@NotNull CharSequence text, @NotNull CharSequence suffix) static booleanendsWithChar(@Nullable CharSequence s, char suffix) static booleanendsWithIgnoreCase(@NotNull CharSequence text, @NotNull CharSequence suffix) static booleanequal(@Nullable CharSequence s1, @Nullable CharSequence s2, boolean caseSensitive) static @NotNull StringformatFileSize(long fileSize) static @NotNull StringformatFileSize(long fileSize, @NotNull String unitSeparator) static @NotNull StringgetShortName(@NotNull Class<?> aClass) static @NotNull StringgetShortName(@NotNull String fqName) static @NotNull StringgetShortName(@NotNull String fqName, char separator) static booleanisEmpty(@Nullable CharSequence cs) static booleanisEmptyOrSpaces(@Nullable CharSequence s) static booleanisQuotedString(@NotNull String s) static intlastIndexOf(@NotNull CharSequence s, char c, int start, int end) Allows to retrieve index of last occurrence of the given symbols at[start; end)sub-sequence of the given text.static @NotNull StringnotNullize(@Nullable String s) static @NotNull StringnotNullize(@Nullable String s, @NotNull String defaultValue) static doubleparseDouble(@Nullable String string, double defaultValue) static intstatic longsplitHonorQuotes(@NotNull String s, char separator) static booleanstartsWith(@NotNull CharSequence text, @NotNull CharSequence prefix) static booleanstartsWithIgnoreCase(@NotNull String str, int startOffset, @NotNull String prefix) static booleanstartsWithIgnoreCase(@NotNull String str, @NotNull String prefix) static intstringHashCodeInsensitive(@NotNull CharSequence chars) static intstringHashCodeInsensitive(@NotNull CharSequence chars, int from, int to) static intstringHashCodeInsensitive(@NotNull CharSequence chars, int from, int to, int prefixHash) static chartoLowerCase(char a) static chartoUpperCase(char a) static @NotNull StringunquoteString(@NotNull String s) static @NotNull StringunquoteString(@NotNull String s, char quotationChar)
-
构造器详细资料
-
StringUtilRt
public StringUtilRt()
-
-
方法详细资料
-
equal
@Contract("null,!null,_ -> false; !null,null,_ -> false; null,null,_ -> true") public static boolean equal(@Nullable @Nullable CharSequence s1, @Nullable @Nullable CharSequence s2, boolean caseSensitive) -
charsEqualIgnoreCase
@Contract(pure=true) public static boolean charsEqualIgnoreCase(char a, char b) -
toUpperCase
@Contract(pure=true) public static char toUpperCase(char a) -
toLowerCase
@Contract(pure=true) public static char toLowerCase(char a) -
convertLineSeparators
@NotNull @Contract(pure=true) public static @NotNull String convertLineSeparators(@NotNull @NotNull String text) Converts line separators to"\n" -
convertLineSeparators
-
convertLineSeparators
-
convertLineSeparators
@NotNull @Contract(pure=true) public static @NotNull CharSequence convertLineSeparators(@NotNull @NotNull CharSequence text, @NotNull @NotNull String newSeparator) -
convertLineSeparators
-
convertLineSeparators
-
parseInt
@Contract(pure=true) public static int parseInt(@Nullable @Nullable String string, int defaultValue) -
parseLong
@Contract(pure=true) public static long parseLong(@Nullable @Nullable String string, long defaultValue) -
parseDouble
@Contract(pure=true) public static double parseDouble(@Nullable @Nullable String string, double defaultValue) -
getShortName
-
getShortName
-
getShortName
-
endsWithChar
@Contract(pure=true) public static boolean endsWithChar(@Nullable @Nullable CharSequence s, char suffix) -
endsWith
@Contract(pure=true) public static boolean endsWith(@NotNull @NotNull CharSequence text, @NotNull @NotNull CharSequence suffix) -
startsWithIgnoreCase
-
startsWithIgnoreCase
-
endsWithIgnoreCase
@Contract(pure=true) public static boolean endsWithIgnoreCase(@NotNull @NotNull CharSequence text, @NotNull @NotNull CharSequence suffix) -
lastIndexOf
@Contract(pure=true) public static int lastIndexOf(@NotNull @NotNull CharSequence s, char c, int start, int end) Allows to retrieve index of last occurrence of the given symbols at[start; end)sub-sequence of the given text.- 参数:
s- target textc- target symbol which last occurrence we want to checkstart- start offset of the target text (inclusive)end- end offset of the target text (exclusive)- 返回:
- index of the last occurrence of the given symbol at the target sub-sequence of the given text if any;
-1otherwise
-
isEmpty
@Contract(value="null -> true", pure=true) public static boolean isEmpty(@Nullable @Nullable CharSequence cs) -
isEmptyOrSpaces
@Contract(value="null -> true", pure=true) public static boolean isEmptyOrSpaces(@Nullable @Nullable CharSequence s) -
notNullize
-
notNullize
-
splitHonorQuotes
-
formatFileSize
-
formatFileSize
-
isQuotedString
- 返回:
- true if the string starts and ends with quote (") or apostrophe (')
-
unquoteString
-
unquoteString
-
startsWith
@Contract(pure=true) public static boolean startsWith(@NotNull @NotNull CharSequence text, @NotNull @NotNull CharSequence prefix) -
stringHashCodeInsensitive
@Contract(pure=true) public static int stringHashCodeInsensitive(@NotNull @NotNull CharSequence chars) -
stringHashCodeInsensitive
@Contract(pure=true) public static int stringHashCodeInsensitive(@NotNull @NotNull CharSequence chars, int from, int to) -
stringHashCodeInsensitive
@Contract(pure=true) public static int stringHashCodeInsensitive(@NotNull @NotNull CharSequence chars, int from, int to, int prefixHash)
-