public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
decapitalize(String string)
Decapitalize a String if it begins with a capital letter, e.g.: FooBar -> fooBar
|
static String |
fromBytes(BaseBytes b)
Return a new String with chars corresponding to b.
|
static String |
fromBytes(byte[] buf)
Return a new String with chars corresponding to buf.
|
static String |
fromBytes(byte[] buf,
int off,
int len)
Return a new String with chars corresponding to buf from off to off + len.
|
static String |
fromBytes(ByteBuffer buf)
Return a new String with chars corresponding to buf.
|
static String |
fromBytes(PyBuffer buf)
Return a new String with chars corresponding to buf, which is a byte-oriented buffer obtained
through the buffer API.
|
static byte[] |
toBytes(String string)
Encodes this String into a sequence of bytes.
|
public static byte[] toBytes(String string)
string
- a String valuepublic static String fromBytes(byte[] buf, int off, int len)
buf
- an array of bytesoff
- the initial offsetlen
- the lengthpublic static String fromBytes(byte[] buf)
buf
- an array of bytespublic static String fromBytes(ByteBuffer buf)
buf
- a ByteBuffer of bytespublic static String fromBytes(PyBuffer buf)
PyBuffer.toString()
provided by each buffer implementation.buf
- a PyBuffer of bytespublic static String fromBytes(BaseBytes b)
b
- a BaseBytes containing bytes