Package com.formdev.flatlaf.util
Class StringUtils
java.lang.Object
com.formdev.flatlaf.util.StringUtils
Utility methods for strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
add
(List<String> strs, String str, int beginIndex, int endIndex, boolean trim, boolean excludeEmpty) static boolean
Returnstrue
if given string isnull
or length is zero.static boolean
isTrimmedEmpty
(String str) This is equal tostr.trim().isEmpty()
, but avoids temporary trimmed substring allocation.static String
removeLeading
(String string, String leading) static String
removeTrailing
(String string, String trailing) Splits a string at the specified delimiter.static String
substringTrimmed
(String str, int beginIndex) This is equal tostr.substring( beginIndex, endIndex ).trim()
, but avoids temporary untrimmed substring allocation.static String
substringTrimmed
(String str, int beginIndex, int endIndex) This is equal tostr.substring( beginIndex ).trim()
, but avoids temporary untrimmed substring allocation.private static int
private static int
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
isEmpty
Returnstrue
if given string isnull
or length is zero. -
removeLeading
-
removeTrailing
-
split
-
split
Splits a string at the specified delimiter. If trimming is enabled, then leading and trailing whitespace characters are removed. If excludeEmpty istrue
, then only non-empty strings are returned.- Since:
- 2
-
add
-
substringTrimmed
This is equal tostr.substring( beginIndex, endIndex ).trim()
, but avoids temporary untrimmed substring allocation. If the trimmed string is empty, a shared empty string is returned.- Since:
- 2
-
substringTrimmed
This is equal tostr.substring( beginIndex ).trim()
, but avoids temporary untrimmed substring allocation. If the trimmed string is empty, a shared empty string is returned.- Since:
- 2
-
isTrimmedEmpty
This is equal tostr.trim().isEmpty()
, but avoids temporary trimmed substring allocation.- Since:
- 2
-
trimBegin
-
trimEnd
-