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 voidadd(List<String> strs, String str, int beginIndex, int endIndex, boolean trim, boolean excludeEmpty) static booleanReturnstrueif given string isnullor length is zero.static booleanisTrimmedEmpty(String str) This is equal tostr.trim().isEmpty(), but avoids temporary trimmed substring allocation.static StringremoveLeading(String string, String leading) static StringremoveTrailing(String string, String trailing) Splits a string at the specified delimiter.static StringsubstringTrimmed(String str, int beginIndex) This is equal tostr.substring( beginIndex, endIndex ).trim(), but avoids temporary untrimmed substring allocation.static StringsubstringTrimmed(String str, int beginIndex, int endIndex) This is equal tostr.substring( beginIndex ).trim(), but avoids temporary untrimmed substring allocation.private static intprivate static int
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
isEmpty
Returnstrueif given string isnullor 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
-