public class StringUtils extends Object
| Constructor and Description |
|---|
StringUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addLineBreaks(String s,
int lineLength)
Add line breaks to the string.
|
static boolean |
equals(String str1,
String str2)
Make a null safe equals comparison of strings.
|
static boolean |
isNullOrEmpty(String string)
Returns true if given string is null or
String.isEmpty(), false otherwise. |
static String |
lineSeparator() |
static String |
removeLineBreaks(String string)
Remove line breaks from the string.
|
static String |
removeWhitespace(String string)
Returns a string which has all whitespace characters removed from the given string.
|
public static String addLineBreaks(String s, int lineLength)
Add line breaks to the string.
s - the string to convert.lineLength - the number of characters per line. Use 0 or negative to omit the line breaks.String with lineSeparator() added after every lineLength
characters.public static boolean equals(String str1, String str2)
str1 - first stringstr2 - second stringpublic static boolean isNullOrEmpty(String string)
String.isEmpty(), false otherwise.public static String lineSeparator()
public static String removeLineBreaks(String string)
Remove line breaks from the string.
Replaces all newline ("\n") and linefeed ("\r") characters in string with an empty string.
string - the string to convertCopyright © 2026. All rights reserved.