public final class StringUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static @Nullable String |
appendIfMissing(@Nullable String str,
@Nullable String suffix)
Appends the suffix to the end of the string if the string does not already end with the suffix.
|
static boolean |
endsWithAny(@Nullable String str,
String... searchStrings)
Check if a string ends with any of the provided case-sensitive suffixes.
|
static boolean |
isBlank(@Nullable String str)
Gets whether the specified string is
null, empty or blank (only whitespace). |
static boolean |
isEmpty(@Nullable String str)
Gets whether the specified string is
null or empty. |
static boolean |
isNotBlank(@Nullable String str)
Gets whether the specified string is not
null, empty or blank (only whitespace). |
static boolean |
isNotEmpty(@Nullable String str)
Gets whether the specified string is not
null nor empty. |
public static @Nullable String appendIfMissing(@Nullable String str, @Nullable String suffix)
str - The string.suffix - The suffix to append to the end of the string.public static boolean endsWithAny(@Nullable String str, String... searchStrings)
str - The string to check, may be null.searchStrings - The case-sensitive string to find, may be empty or contain null.true if the input string is null AND no searchStrings are
provided, or the input str ends in any of the provided case-sensitive searchStrings.public static boolean isEmpty(@Nullable String str)
null or empty.str - The string to check.true if the given string is null or empty; false otherwise.public static boolean isNotEmpty(@Nullable String str)
null nor empty.str - The string to check.true if the given string is nor null nor empty; false otherwise.public static boolean isBlank(@Nullable String str)
null, empty or blank (only whitespace).str - The string to check.true if the given string is null, empty or blank (only whitespace);
false otherwise.public static boolean isNotBlank(@Nullable String str)
null, empty or blank (only whitespace).str - The string to check.true if the given string is not null, empty or blank (only whitespace);
false otherwise.Copyright © 2016 - present; JODConverter.org. All rights reserved.