org.restlet.engine.util

## Class StringUtils

- java.lang.Object
- - org.restlet.engine.util.StringUtils

    public class StringUtils
    extends java.lang.Object

String manipulation utilities.

Author:
  Jerome Louvel

### Method Summary

Methods
`static byte[]` `getAsciiBytes(java.lang.String string)` Encodes the given String into a sequence of bytes using the Ascii character set.
`static byte[]` `getLatin1Bytes(java.lang.String string)` Encodes the given String into a sequence of bytes using the Latin1 character set.
`static java.lang.String` `strip(java.lang.String source, char delimiter)` Strips a delimiter character from both ends of the source string.
`static java.lang.String` `strip(java.lang.String source, char delimiter, boolean start, boolean end)` Strips a delimiter character from a source string.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getAsciiBytes

    public static byte[] getAsciiBytes(java.lang.String string)

Encodes the given String into a sequence of bytes using the Ascii character set.

Parameters:
  `string` - The string to encode.
Returns:
  The String encoded with the Ascii character set as an array of bytes.

#### getLatin1Bytes

    public static byte[] getLatin1Bytes(java.lang.String string)

Encodes the given String into a sequence of bytes using the Latin1 character set.

Parameters:
  `string` - The string to encode.
Returns:
  The String encoded with the Latin1 character set as an array of bytes.

#### strip

    public static java.lang.String strip(java.lang.String source,
                         char delimiter)

Strips a delimiter character from both ends of the source string.

Parameters:
  `source` - The source string to strip.
  `delimiter` - The character to remove.
Returns:
  The stripped string.

#### strip

    public static java.lang.String strip(java.lang.String source,
                         char delimiter,
                         boolean start,
                         boolean end)

Strips a delimiter character from a source string.

Parameters:
  `source` - The source string to strip.
  `delimiter` - The character to remove.
  `start` - Indicates if start of source should be stripped.
  `end` - Indicates if end of source should be stripped.
Returns:
  The stripped source string.