Overview | Package | Class | Use | Deprecated | Help
| GWT 2.7.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.util.tools.shared
Class StringUtils

    java.lang.Object
      com.google.gwt.util.tools.shared.StringUtils

    public class StringUtils

extends java.lang.Object

String utility methods.

Field Summary
`static char[]` | `HEX_CHARS`

Constructor Summary
`StringUtils()`

Method Summary
`static void` | `hex4(char c, java.lang.StringBuffer sb)` A 4-digit hex result.
`static java.lang.String` | `javaScriptString(java.lang.String value)` Generate JavaScript code that evaluates to the supplied string.
`static java.lang.String` | `toHexString(byte[] bytes)` Returns a string representation of the byte array as a series of hexadecimal characters.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### HEX_CHARS

    public static char[] HEX_CHARS

Constructor Detail

### StringUtils

    public StringUtils()

Method Detail

### hex4

    public static void hex4(char c,
                            java.lang.StringBuffer sb)

  A 4-digit hex result.

### javaScriptString

    public static java.lang.String javaScriptString(java.lang.String value)

  Generate JavaScript code that evaluates to the supplied string. Adapted from `com.google.gwt.dev.js.rhino.ScriptRuntime#escapeString(String)` . The difference is that we quote with either " or ' depending on which one is used less inside the string.

### toHexString

    public static java.lang.String toHexString(byte[] bytes)

  Returns a string representation of the byte array as a series of hexadecimal characters.

  Parameters:
    `bytes` - byte array to convert
  Returns:
    a string representation of the byte array as a series of hexadecimal characters

Overview | Package | Class | Use | Deprecated | Help
| GWT 2.7.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD