Package com.palmergames.util
Class StringMgmt
java.lang.Object
com.palmergames.util.StringMgmt
Useful functions related to strings, or arrays of them.
- Version:
- 1.4
- Author:
- Shade (Chris H)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String str) static StringcapitalizeStrings(String string) Capitalizes the beginning of each word, accounting for underscores separating those wordsstatic booleancontainsIgnoreCase(List<String> arr, String str) static booleanisAllUpperCase(@NotNull String string) static booleanisAllUpperCase(@NotNull Collection<String> collection) static Stringstatic Stringstatic Stringjoin(Collection<?> args) static Stringjoin(Collection<?> args, String separator) static Stringstatic StringShortens the string to fit in the specified size with an ellipse "..." at the end.static booleanparseOnOff(String s) static String[]static String[]remFirstArg(String[] arr) static String[]remLastArg(String[] arr) static StringremUnderscore(String str) Replaces underscores with spaces.static Stringstatic String[]static StringtranslateHexColors(String string) static StringtranslateHexColors(String string, Function<String, String> hexFunction) static StringtrimMaxLength(String str, int length) Shortens the string to fit in the specified size.static String
-
Field Details
-
hexPattern
-
hexReplacePattern
-
-
Constructor Details
-
StringMgmt
public StringMgmt()
-
-
Method Details
-
translateHexColors
-
translateHexColors
-
join
-
join
-
join
-
join
-
join
-
repeat
-
remFirstArg
-
remLastArg
-
remArgs
-
subArray
-
trimMaxLength
Shortens the string to fit in the specified size.- Parameters:
str- -Stringto trimlength- - length to trim to- Returns:
- the shortened string
-
maxLength
Shortens the string to fit in the specified size with an ellipse "..." at the end.- Parameters:
str- -Stringto fitlength- - Length of the string, before shortening- Returns:
- the shortened string, followed with ellipses
-
containsIgnoreCase
-
remUnderscore
Replaces underscores with spaces.- Parameters:
str- - the string to change.- Returns:
- the string with spaces replacing underscores.
-
capitalize
-
capitalizeStrings
Capitalizes the beginning of each word, accounting for underscores separating those words- Parameters:
string- String to capitalize.- Returns:
- String with the beginning letter of each word capitalized.
-
parseOnOff
- Throws:
Exception
-
isAllUpperCase
-
isAllUpperCase
-
addToList
-
wrap
-