public class StringUtils extends Object
Modifier and Type | Field and Description |
---|---|
static char[] |
HEX_CHARS |
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
hex4(char c,
StringBuffer sb)
A 4-digit hex result.
|
static String |
javaScriptString(String value)
Generate JavaScript code that evaluates to the supplied string.
|
static String |
toHexString(byte[] bytes)
Returns a string representation of the byte array as a series of
hexadecimal characters.
|
public static void hex4(char c, StringBuffer sb)
public static String javaScriptString(String value)
ScriptRuntime.escapeString(String)
. The difference is that we quote with either " or ' depending on
which one is used less inside the string.public static String toHexString(byte[] bytes)
bytes
- byte array to convertCopyright © 2018. All rights reserved.