public class StringUtil
extends java.lang.Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decapitalize(java.lang.String string)
Decapitalize a String if it begins with a capital letter, e.g.:
FooBar -> fooBar
|
static java.lang.String |
fromBytes(byte[] buf)
Return a new String with chars corresponding to buf.
|
static java.lang.String |
fromBytes(byte[] buf,
int off,
int len)
Return a new String with chars corresponding to buf from off to
off + len.
|
static java.lang.String |
fromBytes(java.nio.ByteBuffer buf)
Return a new String with chars corresponding to buf.
|
static byte[] |
toBytes(java.lang.String string)
Encodes this String into a sequence of bytes.
|
public static byte[] toBytes(java.lang.String string)
string
- a String valuepublic static java.lang.String fromBytes(byte[] buf, int off, int len)
buf
- an array of bytesoff
- the initial offsetlen
- the lengthpublic static java.lang.String fromBytes(byte[] buf)
buf
- an array of bytespublic static java.lang.String fromBytes(java.nio.ByteBuffer buf)
buf
- a ByteBuffer of bytespublic static java.lang.String decapitalize(java.lang.String string)
string
- a String