Package arc.util
Class Strings
java.lang.Object
arc.util.Strings
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
autoFixed
(float value, int max) static String
Converts a Space Separated string to camelCase.static String
static boolean
static boolean
static boolean
static boolean
static String
capitalize
(String s) Converts a snake_case or kebab-case string to Upper Case.static int
count
(CharSequence s, char c) static int
static String
static String
fixed
(float d, int decimalPlaces) static StringBuilder
fixedBuilder
(float d, int decimalPlaces) static String
static String
formatMillis
(long val) static Throwable
static String
static String
static String
static String
Adds spaces to a camel/pascal case string.static String
static String
static String
static int
levenshtein
(String x, String y) Returns the levenshtein distance between two strings.static boolean
static String
static String
static double
parseDouble
(String value, double defaultValue) Faster double parser that doesn't throw exceptions.static float
parseFloat
(String s) Returns Float.NEGATIVE_INFINITY if parsing failed.static float
parseFloat
(String s, float defaultValue) static int
Returns Integer.MIN_VALUE if parsing failed.static int
static int
static int
static long
static long
static long
static StringBuilder
replace
(StringBuilder builder, char find, String replace) Replaces all instances offind
withreplace
.static StringBuilder
replace
(StringBuilder builder, String find, String replace) Replaces all instances offind
withreplace
.static String
sanitizeFilename
(String str) Replaces non-safe filename characters with '_'.static String
stripColors
(CharSequence str) static String
stripGlyphs
(CharSequence str) static String
static String
-
Field Details
-
utf8
-
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
matches
- Returns:
- whether the name matches the query; case-insensitive. Always returns true if query is empty.
-
count
-
truncate
-
truncate
-
getCauses
-
getSimpleMessage
-
getFinalMessage
-
getFinalCause
-
getStackTrace
-
neatError
- Returns:
- a neat error message of a throwable, with stack trace.
-
neatError
- Returns:
- a neat error message of a throwable, with stack trace.
-
stripColors
-
stripGlyphs
-
count
-
sanitizeFilename
Replaces non-safe filename characters with '_'. Handles reserved window file names. -
encode
-
format
-
join
-
join
-
levenshtein
Returns the levenshtein distance between two strings. -
animated
-
kebabToCamel
-
camelToKebab
-
capitalize
Converts a snake_case or kebab-case string to Upper Case. For example: "test_string" -> "Test String" -
insertSpaces
Adds spaces to a camel/pascal case string. -
camelize
Converts a Space Separated string to camelCase. For example: "Camel Case" -> "camelCase" -
canParseInt
-
canParsePositiveInt
-
parseInt
-
parseInt
-
parseInt
-
parseLong
-
parseLong
-
parseLong
-
parseDouble
Faster double parser that doesn't throw exceptions. -
parseInt
Returns Integer.MIN_VALUE if parsing failed. -
canParseFloat
-
canParsePositiveFloat
-
parseFloat
Returns Float.NEGATIVE_INFINITY if parsing failed. -
parseFloat
-
autoFixed
-
fixed
-
fixedBuilder
-
formatMillis
-
replace
Replaces all instances offind
withreplace
. -
replace
Replaces all instances offind
withreplace
.
-