public class StringHelper
extends java.lang.Object
Constructor and Description |
---|
StringHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
format(java.lang.String template,
boolean b)
Return a String representation of a boolean.
|
static java.lang.String |
format(java.lang.String template,
char c)
Return a String representation of a char.
|
static java.lang.String |
format(java.lang.String template,
double d)
Round a number to a specified number of decimal places.
|
static java.lang.String |
format(java.lang.String template,
int i)
Return a String representation of a int.
|
static java.lang.String |
format(java.lang.String template,
java.lang.Object obj)
Return a String representation of a String or other Object.
|
static java.lang.String |
format(java.lang.String template,
java.lang.String one,
java.lang.String two,
java.lang.String three)
Return a concatenation of three strings.
|
public static java.lang.String format(java.lang.String template, double d)
template
- "%.0f" "%.1f" "%.2f" "%.3f" ... "%.9f" onlyd
- A double or floatpublic static java.lang.String format(java.lang.String template, boolean b)
template
- "%b"b
- public static java.lang.String format(java.lang.String template, char c)
template
- "%c"c
- public static java.lang.String format(java.lang.String template, int i)
template
- "%d"i
- public static java.lang.String format(java.lang.String template, java.lang.Object obj)
template
- "%s"obj
- public static java.lang.String format(java.lang.String template, java.lang.String one, java.lang.String two, java.lang.String three)
template
- It must be "%s|%s|%s"one
- two
- three
-