Package com.intellij.openapi.util.text
Class StringUtilRt
java.lang.Object
com.intellij.openapi.util.text.StringUtilRt
- Direct Known Subclasses:
StringUtil
Stripped-down version of
com.intellij.openapi.util.text.StringUtil.
Intended to use by external (out-of-IDE-process) runners and helpers so it should not contain any library dependencies.- Since:
- 12.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancharsEqualIgnoreCase(char a, char b) static CharSequenceconvertLineSeparators(CharSequence text, String newSeparator) static StringconvertLineSeparators(String text) Converts line separators to"\n"static StringconvertLineSeparators(String text, boolean keepCarriageReturn) static StringconvertLineSeparators(String text, String newSeparator) static StringconvertLineSeparators(String text, String newSeparator, int[] offsetsToKeep) static StringconvertLineSeparators(String text, String newSeparator, int[] offsetsToKeep, boolean keepCarriageReturn) static booleanendsWithChar(CharSequence s, char suffix) static booleanendsWithIgnoreCase(CharSequence text, CharSequence suffix) static StringgetShortName(Class aClass) static StringgetShortName(String fqName) static StringgetShortName(String fqName, char separator) static intlastIndexOf(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 booleanparseBoolean(String string, boolean defaultValue) static doubleparseDouble(String string, double defaultValue) static <E extends Enum<E>>
Estatic intstatic longstatic booleanstartsWithIgnoreCase(String str, String prefix) static chartoLowerCase(char a) static chartoUpperCase(char a) static CharSequencestatic CharSequenceunifyLineSeparators(CharSequence text, String newSeparator, int[] offsetsToKeep, boolean keepCarriageReturn)
-
Constructor Details
-
StringUtilRt
public StringUtilRt()
-
-
Method Details
-
charsEqualIgnoreCase
-
toUpperCase
-
toUpperCase
-
toLowerCase
-
convertLineSeparators
Converts line separators to"\n" -
convertLineSeparators
-
convertLineSeparators
-
convertLineSeparators
@NotNull @Contract(pure=true) public static CharSequence convertLineSeparators(@NotNull CharSequence text, @NotNull String newSeparator) -
convertLineSeparators
-
convertLineSeparators
-
unifyLineSeparators
@NotNull public static CharSequence unifyLineSeparators(@NotNull CharSequence text, @NotNull String newSeparator, @Nullable int[] offsetsToKeep, boolean keepCarriageReturn) -
parseInt
-
parseLong
-
parseDouble
-
parseBoolean
-
parseEnum
-
getShortName
-
getShortName
-
getShortName
-
endsWithChar
-
startsWithIgnoreCase
-
endsWithIgnoreCase
@Contract(pure=true) public static boolean endsWithIgnoreCase(@NonNls @NotNull CharSequence text, @NonNls @NotNull CharSequence suffix) -
lastIndexOf
@Contract(pure=true) public static int lastIndexOf(@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.- Parameters:
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)- Returns:
- index of the last occurrence of the given symbol at the target sub-sequence of the given text if any;
-1otherwise
-