@Deprecated public class TextUtil extends Object
Plugins should prefer external frameworks over this class.
Constructor | Description |
---|---|
TextUtil() |
Deprecated.
|
Modifier and Type | Method | Description |
---|---|---|
static String |
camelToKebabCase(String camelCase) |
Deprecated.
|
static boolean |
containsWhitespace(String str) |
Deprecated.
Tells whether the specified string contains any whitespace characters.
|
static String |
convertLineSeparators(String str,
String sep) |
Deprecated.
Converts all line separators in the specified string to the specified line separator.
|
static String |
convertLineSeparatorsToUnix(String str) |
Deprecated.
Converts all line separators in the specified non-null string to the Unix line separator
\n . |
static String |
escapeString(Object obj) |
Deprecated.
Escapes the toString() representation of
obj for use in a literal string. |
static String |
getPlatformLineSeparator() |
Deprecated.
Returns the line separator for this platform.
|
static String |
getUnixLineSeparator() |
Deprecated.
Returns the line separator for Unix.
|
static String |
getWindowsLineSeparator() |
Deprecated.
Returns the line separator for Windows.
|
static String |
indent(String text,
String indent) |
Deprecated.
Indents every line of
text by indent . |
static String |
minus(String originalString,
String removeString) |
Deprecated.
Same behavior as Groovy minus operator between Strings
|
static String |
normaliseFileAndLineSeparators(String in) |
Deprecated.
|
static String |
normaliseFileSeparators(String path) |
Deprecated.
Converts all native file separators in the specified string to '/'.
|
static String |
normaliseLineSeparators(String str) |
Deprecated.
Converts all line separators in the specified nullable string to a single new line character (
\n ). |
static String |
replaceLineSeparatorsOf(CharSequence string,
String bySeparator) |
Deprecated.
Converts all line separators in the specified non-null
CharSequence to the specified line separator. |
static String |
shorterOf(String s1,
String s2) |
Deprecated.
|
static String |
toLowerCaseLocaleSafe(String s) |
Deprecated.
This method should be used when making strings lowercase that
could be affected by locale differences.
|
static String |
toPlatformLineSeparators(String str) |
Deprecated.
Converts all line separators in the specified string to the platform's line separator.
|
public static String getWindowsLineSeparator()
public static String getUnixLineSeparator()
public static String getPlatformLineSeparator()
@Nullable public static String convertLineSeparators(@Nullable String str, String sep)
public static String convertLineSeparatorsToUnix(String str)
\n
.public static String replaceLineSeparatorsOf(CharSequence string, String bySeparator)
CharSequence
to the specified line separator.public static String toPlatformLineSeparators(String str)
@Nullable public static String normaliseLineSeparators(@Nullable String str)
\n
).public static String normaliseFileSeparators(String path)
public static String escapeString(Object obj)
obj
for use in a literal string.
This is useful for interpolating variables into script strings, as well as in other situations.public static boolean containsWhitespace(String str)
public static String indent(String text, String indent)
text
by indent
. Empty lines
and lines that only contain whitespace are not indented.public static String minus(String originalString, String removeString)
originalString
- original stringremoveString
- string to removepublic static String normaliseFileAndLineSeparators(String in)
public static String toLowerCaseLocaleSafe(String s)
s
- string to be made lowercase