| Modifier and Type | Field and Description |
|---|---|
| public static final char | ESCAPE_CHAR
Escape character used for terminal formatting |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static @NotNull String | |
| public static @NotNull String | |
| public static @NotNull String | Returns: the escaped stringthe string to escape str)Replaces all quotes in the given string with escaped quotes. |
| public static int | getLengthIgnoreSequences(@NotNull String str)
Returns the length of the string, ignoring any formatting sequences. |
| public static @NotNull String | |
| public static @NotNull String | |
| public static @NotNull String | |
| public static boolean | Returns: true if the string isnull or blankthe string to check str)Returns true if the string given is |
| public static boolean | Returns: true if the string isnull or emptythe string to check str)Returns true if the string given is |
| public static @NotNull String | |
| public static @NotNull String | |
| public static @NotNull @NotNull String[] | |
| public static @NotNull @NotNull String[] | |
| public static @NotNull @NotNull String[] | |
| public static @NotNull Pair | Returns: a pair of stringsthe string to split str)Returns a pair of strings. |
| public static @NotNull String |
| ESCAPE_CHAR | back to summary |
|---|---|
| public static final char ESCAPE_CHAR Escape character used for terminal formatting | |
| UtlString | back to summary |
|---|---|
| private UtlString() | |
| center | back to summary |
|---|---|
| public static @NotNull String center(@NotNull String str, int width, char padChar) Centers a string in a given width. If the string is longer than the width, it is returned as is. | |
| center | back to summary |
|---|---|
| public static @NotNull String center(@NotNull String str, int width) Centers a string in a given width. '-' is used to fill the remaining space. The padding is equal on both sides of the string, even if the width is odd. | |
| escapeQuotes | back to summary |
|---|---|
| public static @NotNull String escapeQuotes(@NotNull String str) Replaces all quotes in the given string with escaped quotes. For example, | |
| getLengthIgnoreSequences | back to summary |
|---|---|
| public static int getLengthIgnoreSequences(@NotNull String str) Returns the length of the string, ignoring any formatting sequences. | |
| getLongestLine | back to summary |
|---|---|
| public static @NotNull String getLongestLine(@NotNull String str) Get the longest line from the contents of a string. Lines are separated by newlines and the length is calculated without counting the escape sequences.
| |
| indent | back to summary |
|---|---|
| public static @NotNull String indent(@NotNull String str, int padCount, char padChar) Adds | |
| indent | back to summary |
|---|---|
| public static @NotNull String indent(@NotNull String str, int padCount) Adds | |
| isNullOrBlank | back to summary |
|---|---|
| public static boolean isNullOrBlank(@Nullable String str) Returns true if the string given is | |
| isNullOrEmpty | back to summary |
|---|---|
| public static boolean isNullOrEmpty(@Nullable String str) Returns true if the string given is | |
| plural | back to summary |
|---|---|
| public static @NotNull String plural(@NotNull String str, int count) Returns the count given appended to the string given. An | |
| removeSequences | back to summary |
|---|---|
| public static @NotNull String removeSequences(@NotNull String str) Remove all formatting colors or format from the string
| |
| split | back to summary |
|---|---|
| public static @NotNull @NotNull String[] split(@NotNull String str, @NotNull String splitter, int max) Split a string by the given splitter. This is similar to | |
| split | back to summary |
|---|---|
| public static @NotNull @NotNull String[] split(@NotNull String str, char splitter, int max) Split a string by the given splitter. This is similar to | |
| split | back to summary |
|---|---|
| public static @NotNull @NotNull String[] split(@NotNull String str, char splitter)
| |
| splitAtLeadingWhitespace | back to summary |
|---|---|
| public static @NotNull Pair Returns a pair of strings. The first string is the leading whitespace of the string given, and the second string is the string given without the leading whitespace. | |
| wrap | back to summary |
|---|---|
| public static @NotNull String wrap(@NotNull String str, int maxWidth) Wraps a string into multiple lines in order to fit in the given maximum width. Wrapping respects words and indentation, so no word will be split in two lines and indentation will be preserved. | |