public class TextUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static float |
parseFloat(java.lang.String str,
float defaultValue)
Parse a string value as a floating point number.
|
static float[] |
parseFloatArray(java.lang.String str)
Parse string as an array of floats separated by white space.
|
static int |
parseInt(java.lang.String str,
int defaultValue)
Parse a string value as an integer.
|
static int[] |
parseIntArray(java.lang.String str)
Parse string as an array of integers separated by white space.
|
static java.lang.String |
toString(java.lang.Throwable t)
Convert exception stack trace to a string.
|
public static float parseFloat(java.lang.String str, float defaultValue)
str
- Input string.defaultValue
- Value returned if str
can not be parsed as a floating point
number.public static int parseInt(java.lang.String str, int defaultValue)
str
- Input string.defaultValue
- Value returned if str
can not be parsed as a integer.public static int[] parseIntArray(java.lang.String str) throws java.lang.IllegalArgumentException
str
- Input string.java.lang.IllegalArgumentException
- In case of parsing error.public static float[] parseFloatArray(java.lang.String str) throws java.lang.IllegalArgumentException
str
- Input string.java.lang.IllegalArgumentException
- In case of parsing error.public static java.lang.String toString(java.lang.Throwable t)
t
- exception