StringUtils
Date: 2016-03-08

com.mysql.jdbc

## Class StringUtils

- java.lang.Object
- - com.mysql.jdbc.StringUtils

-     public class StringUtils
      extends java.lang.Object

  Various utility methods for converting to/from byte arrays in the platform encoding

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StringUtils.SearchMode`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__ALL` Full search mode: allow backslash escape, skip between markers, skip block comments, skip line comments and skip white space.
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__BSESC_COM_WS` Search mode: allow backslash escape, skip block comments, skip line comments and skip white space.
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__BSESC_MRK_WS` Search mode: allow backslash escape, skip between markers and skip white space.
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__COM_WS` Search mode: skip block comments, skip line comments and skip white space.
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__MRK_COM_WS` Search mode: skip between markers, skip block comments, skip line comments and skip white space.
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__MRK_WS` Search mode: skip between markers and skip white space.
    `static java.util.Set<StringUtils.SearchMode>` | `SEARCH_MODE__NONE` Empty search mode.
    `(package private) static int` | `WILD_COMPARE_MATCH_NO_WILD`
    `(package private) static int` | `WILD_COMPARE_MATCH_WITH_WILD`
    `(package private) static int` | `WILD_COMPARE_NO_MATCH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `appendAsHex(java.lang.StringBuilder builder, byte[] bytes)`
    `static void` | `appendAsHex(java.lang.StringBuilder builder, int value)`
    `static java.lang.String` | `consistentToString(java.math.BigDecimal decimal)` Takes care of the fact that Sun changed the output of BigDecimal.toString() between JDK-1.4 and JDK 5
    `static java.lang.String` | `dumpAsHex(byte[] byteBuffer, int length)` Dumps the given bytes to STDOUT as a hex dump (up to length bytes).
    `static byte[]` | `escapeEasternUnicodeByteStream(byte[] origBytes, java.lang.String origString)` Unfortunately, SJIS has 0x5c as a high byte in some of its double-byte characters, so we need to escape it.
    `static java.lang.String` | `escapeQuote(java.lang.String src, java.lang.String quotChar)`
    `(package private) static java.nio.charset.Charset` | `findCharset(java.lang.String alias)`
    `static char` | `firstAlphaCharUc(java.lang.String searchIn, int startAt)`
    `static char` | `firstNonWsCharUc(java.lang.String searchIn)` Returns the first non whitespace char, converted to upper case
    `static char` | `firstNonWsCharUc(java.lang.String searchIn, int startAt)`
    `static java.lang.String` | `fixDecimalExponent(java.lang.String dString)` Adds '+' to decimal numbers that are positive (MySQL doesn't understand them otherwise
    `static byte[]` | `getBytes(char[] value)`
    `static byte[]` | `getBytes(char[] value, int offset, int length)`
    `static byte[]` | `getBytes(char[] value, int offset, int length, java.lang.String encoding)`
    `static byte[]` | `getBytes(char[] c, SingleByteCharsetConverter converter, java.lang.String encoding, java.lang.String serverEncoding, boolean parserKnowsUnicode, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of the given char[] (re)using the given charset converter, and the given encoding.
    `static byte[]` | `getBytes(char[] c, SingleByteCharsetConverter converter, java.lang.String encoding, java.lang.String serverEncoding, int offset, int length, boolean parserKnowsUnicode, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of subset of the given char[] (re)using the given charset converter, and the given encoding.
    `static byte[]` | `getBytes(char[] value, java.lang.String encoding)`
    `static byte[]` | `getBytes(char[] c, java.lang.String encoding, java.lang.String serverEncoding, boolean parserKnowsUnicode, MySQLConnection conn, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of the given char[] (re)using a cached charset converter, and the given encoding.
    `static byte[]` | `getBytes(java.lang.String value)`
    `static byte[]` | `getBytes(java.lang.String value, int offset, int length)`
    `static byte[]` | `getBytes(java.lang.String value, int offset, int length, java.lang.String encoding)`
    `static byte[]` | `getBytes(java.lang.String s, SingleByteCharsetConverter converter, java.lang.String encoding, java.lang.String serverEncoding, boolean parserKnowsUnicode, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of the given string (re)using the given charset converter, and the given encoding.
    `static byte[]` | `getBytes(java.lang.String s, SingleByteCharsetConverter converter, java.lang.String encoding, java.lang.String serverEncoding, int offset, int length, boolean parserKnowsUnicode, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of a substring of the given string (re)using the given charset converter, and the given encoding.
    `static byte[]` | `getBytes(java.lang.String value, java.lang.String encoding)`
    `static byte[]` | `getBytes(java.lang.String s, java.lang.String encoding, java.lang.String serverEncoding, boolean parserKnowsUnicode, MySQLConnection conn, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of the given string (re)using a cached charset converter, and the given encoding.
    `static byte[]` | `getBytes(java.lang.String s, java.lang.String encoding, java.lang.String serverEncoding, int offset, int length, boolean parserKnowsUnicode, MySQLConnection conn, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of a substring of the given string (re)using a cached charset converter, and the given encoding.
    `static byte[]` | `getBytesNullTerminated(java.lang.String value, java.lang.String encoding)`
    `static byte[]` | `getBytesWrapped(java.lang.String s, char beginWrap, char endWrap, SingleByteCharsetConverter converter, java.lang.String encoding, java.lang.String serverEncoding, boolean parserKnowsUnicode, ExceptionInterceptor exceptionInterceptor)` Returns the byte[] representation of the given string properly wrapped between the given char delimiters, (re)using the given charset converter, and the given encoding.
    `static int` | `getInt(byte[] buf)`
    `static int` | `getInt(byte[] buf, int offset, int endPos)`
    `static long` | `getLong(byte[] buf)`
    `static long` | `getLong(byte[] buf, int offset, int endpos)`
    `static short` | `getShort(byte[] buf)`
    `static short` | `getShort(byte[] buf, int offset, int endpos)`
    `static int` | `indexOf(byte[] s, char c)`
    `static int` | `indexOfIgnoreCase(int startingPosition, java.lang.String searchIn, java.lang.String searchFor)` Finds the position of a substring within a string ignoring case.
    `static int` | `indexOfIgnoreCase(int startingPosition, java.lang.String searchIn, java.lang.String[] searchForSequence, java.lang.String openingMarkers, java.lang.String closingMarkers, java.util.Set<StringUtils.SearchMode> searchMode)` Finds the position of the first of a consecutive sequence of strings within a string, ignoring case, with the option to skip text delimited by given markers or within comments.
    `static int` | `indexOfIgnoreCase(int startingPosition, java.lang.String searchIn, java.lang.String searchFor, java.lang.String openingMarkers, java.lang.String closingMarkers, java.util.Set<StringUtils.SearchMode> searchMode)` Finds the position of a substring within a string, ignoring case, with the option to skip text delimited by given markers or within comments.
    `static int` | `indexOfIgnoreCase(java.lang.String searchIn, java.lang.String searchFor)` Finds the position of a substring within a string ignoring case.
    `static int` | `indexOfQuoteDoubleAware(java.lang.String searchIn, java.lang.String quoteChar, int startFrom)`
    `static boolean` | `isEmptyOrWhitespaceOnly(java.lang.String str)`
    `static boolean` | `isNullOrEmpty(java.lang.String toTest)`
    `static boolean` | `isValidIdChar(char c)`
    `static int` | `lastIndexOf(byte[] s, char c)`
    `static java.lang.String` | `quoteIdentifier(java.lang.String identifier, boolean isPedantic)` Surrounds identifier with "`" and duplicates these symbols inside the identifier.
    `static java.lang.String` | `quoteIdentifier(java.lang.String identifier, java.lang.String quoteChar, boolean isPedantic)` Surrounds identifier with quoteChar and duplicates these symbols inside the identifier.
    `(package private) static byte[]` | `s2b(java.lang.String s, MySQLConnection conn)`
    `static java.lang.String` | `sanitizeProcOrFuncName(java.lang.String src)` Next two functions are to help DBMD check if the given string is in form of database.name and return it as "database";"name" with comments removed.
    `static java.util.List<java.lang.String>` | `split(java.lang.String stringToSplit, java.lang.String delimiter, boolean trim)` Splits stringToSplit into a list, using the given delimiter
    `static java.util.List<java.lang.String>` | `split(java.lang.String stringToSplit, java.lang.String delimiter, java.lang.String markers, java.lang.String markerCloses, boolean trim)` Splits stringToSplit into a list, using the given delimiter
    `static java.util.List<java.lang.String>` | `splitDBdotName(java.lang.String src, java.lang.String cat, java.lang.String quotId, boolean isNoBslashEscSet)` Next we check if there is anything to split.
    `static boolean` | `startsWithIgnoreCase(java.lang.String searchIn, int startAt, java.lang.String searchFor)` Determines whether or not the string 'searchIn' contains the string 'searchFor', dis-regarding case starting at 'startAt' Shorthand for a String.regionMatch(...)
    `static boolean` | `startsWithIgnoreCase(java.lang.String searchIn, java.lang.String searchFor)` Determines whether or not the string 'searchIn' contains the string 'searchFor', dis-regarding case.
    `static boolean` | `startsWithIgnoreCaseAndNonAlphaNumeric(java.lang.String searchIn, java.lang.String searchFor)` Determines whether or not the string 'searchIn' contains the string 'searchFor', disregarding case,leading whitespace and non-alphanumeric characters.
    `static boolean` | `startsWithIgnoreCaseAndWs(java.lang.String searchIn, java.lang.String searchFor)` Determines whether or not the string 'searchIn' contains the string 'searchFor', disregarding case and leading whitespace
    `static int` | `startsWithIgnoreCaseAndWs(java.lang.String searchIn, java.lang.String[] searchFor)` Determines whether or not the string 'searchIn' starts with one of the strings in 'searchFor', disregarding case and leading whitespace
    `static boolean` | `startsWithIgnoreCaseAndWs(java.lang.String searchIn, java.lang.String searchFor, int beginPos)` Determines whether or not the string 'searchIn' contains the string 'searchFor', disregarding case and leading whitespace
    `static java.lang.String` | `stripComments(java.lang.String src, java.lang.String stringOpens, java.lang.String stringCloses, boolean slashStarComments, boolean slashSlashComments, boolean hashComments, boolean dashDashComments)` Returns the given string, with comments removed
    `static byte[]` | `stripEnclosure(byte[] source, java.lang.String prefix, java.lang.String suffix)`
    `static java.lang.String` | `toAsciiString(byte[] buffer)` Returns the bytes as an ASCII String.
    `static java.lang.String` | `toAsciiString(byte[] buffer, int startPos, int length)` Returns the bytes as an ASCII String.
    `static java.lang.String` | `toString(byte[] value)`
    `static java.lang.String` | `toString(byte[] value, int offset, int length)`
    `static java.lang.String` | `toString(byte[] value, int offset, int length, java.lang.String encoding)`
    `static java.lang.String` | `toString(byte[] value, java.lang.String encoding)`
    `static java.lang.String` | `unQuoteIdentifier(java.lang.String identifier, java.lang.String quoteChar)` Trims identifier, removes quote chars from first and last positions and replaces double occurrences of quote char from entire identifier, i.e converts quoted identifier into form as it is stored in database.
    `static int` | `wildCompare(java.lang.String searchIn, java.lang.String searchForWildcard)` Compares searchIn against searchForWildcard with wildcards (heavily borrowed from strings/ctype-simple.c in the server sources)

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

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

- - ### Field Detail

    - #### SEARCH_MODE__ALL

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__ALL

      Full search mode: allow backslash escape, skip between markers, skip block comments, skip line comments and skip white space.

    - #### SEARCH_MODE__MRK_COM_WS

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__MRK_COM_WS

      Search mode: skip between markers, skip block comments, skip line comments and skip white space.

    - #### SEARCH_MODE__BSESC_COM_WS

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__BSESC_COM_WS

      Search mode: allow backslash escape, skip block comments, skip line comments and skip white space.

    - #### SEARCH_MODE__BSESC_MRK_WS

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__BSESC_MRK_WS

      Search mode: allow backslash escape, skip between markers and skip white space.

    - #### SEARCH_MODE__COM_WS

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__COM_WS

      Search mode: skip block comments, skip line comments and skip white space.

    - #### SEARCH_MODE__MRK_WS

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__MRK_WS

      Search mode: skip between markers and skip white space.

    - #### SEARCH_MODE__NONE

          public static final java.util.Set<StringUtils.SearchMode> SEARCH_MODE__NONE

      Empty search mode.

    - #### WILD_COMPARE_MATCH_NO_WILD

          static final int WILD_COMPARE_MATCH_NO_WILD

      See Also:
        Constant Field Values

    - #### WILD_COMPARE_MATCH_WITH_WILD

          static final int WILD_COMPARE_MATCH_WITH_WILD

      See Also:
        Constant Field Values

    - #### WILD_COMPARE_NO_MATCH

          static final int WILD_COMPARE_NO_MATCH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StringUtils

          public StringUtils()

  - ### Method Detail

    - #### findCharset

          static java.nio.charset.Charset findCharset(java.lang.String alias)
                                               throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### consistentToString

          public static java.lang.String consistentToString(java.math.BigDecimal decimal)

      Takes care of the fact that Sun changed the output of BigDecimal.toString() between JDK-1.4 and JDK 5
      Parameters:
        `decimal` - the big decimal to stringify
      Returns:
        a string representation of 'decimal'

    - #### dumpAsHex

          public static java.lang.String dumpAsHex(byte[] byteBuffer,
                                   int length)

      Dumps the given bytes to STDOUT as a hex dump (up to length bytes).
      Parameters:
        `byteBuffer` - the data to print as hex
        `length` - the number of bytes to print
      Returns:
        ...

    - #### escapeEasternUnicodeByteStream

          public static byte[] escapeEasternUnicodeByteStream(byte[] origBytes,
                                              java.lang.String origString)

      Unfortunately, SJIS has 0x5c as a high byte in some of its double-byte characters, so we need to escape it.
      Parameters:
        `origBytes` - the original bytes in SJIS format
        `origString` - the string that had .getBytes() called on it
      Returns:
        byte[] with 0x5c escaped

    - #### firstNonWsCharUc

          public static char firstNonWsCharUc(java.lang.String searchIn)

      Returns the first non whitespace char, converted to upper case
      Parameters:
        `searchIn` - the string to search in
      Returns:
        the first non-whitespace character, upper cased.

    - #### firstNonWsCharUc

          public static char firstNonWsCharUc(java.lang.String searchIn,
                              int startAt)

    - #### firstAlphaCharUc

          public static char firstAlphaCharUc(java.lang.String searchIn,
                              int startAt)

    - #### fixDecimalExponent

          public static java.lang.String fixDecimalExponent(java.lang.String dString)

      Adds '+' to decimal numbers that are positive (MySQL doesn't understand them otherwise
      Parameters:
        `dString` - The value as a string
      Returns:
        String the string with a '+' added (if needed)

    - #### getBytes

          public static byte[] getBytes(char[] c,
                        SingleByteCharsetConverter converter,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        boolean parserKnowsUnicode,
                        ExceptionInterceptor exceptionInterceptor)
                                 throws java.sql.SQLException

      Returns the byte[] representation of the given char[] (re)using the given charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytes

          public static byte[] getBytes(char[] c,
                        SingleByteCharsetConverter converter,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        int offset,
                        int length,
                        boolean parserKnowsUnicode,
                        ExceptionInterceptor exceptionInterceptor)
                                 throws java.sql.SQLException

      Returns the byte[] representation of subset of the given char[] (re)using the given charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytes

          public static byte[] getBytes(char[] c,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        boolean parserKnowsUnicode,
                        MySQLConnection conn,
                        ExceptionInterceptor exceptionInterceptor)
                                 throws java.sql.SQLException

      Returns the byte[] representation of the given char[] (re)using a cached charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytes

          public static byte[] getBytes(java.lang.String s,
                        SingleByteCharsetConverter converter,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        boolean parserKnowsUnicode,
                        ExceptionInterceptor exceptionInterceptor)
                                 throws java.sql.SQLException

      Returns the byte[] representation of the given string (re)using the given charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytes

          public static byte[] getBytes(java.lang.String s,
                        SingleByteCharsetConverter converter,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        int offset,
                        int length,
                        boolean parserKnowsUnicode,
                        ExceptionInterceptor exceptionInterceptor)
                                 throws java.sql.SQLException

      Returns the byte[] representation of a substring of the given string (re)using the given charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytes

          public static byte[] getBytes(java.lang.String s,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        boolean parserKnowsUnicode,
                        MySQLConnection conn,
                        ExceptionInterceptor exceptionInterceptor)
                                 throws java.sql.SQLException

      Returns the byte[] representation of the given string (re)using a cached charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytes

          public static final byte[] getBytes(java.lang.String s,
                        java.lang.String encoding,
                        java.lang.String serverEncoding,
                        int offset,
                        int length,
                        boolean parserKnowsUnicode,
                        MySQLConnection conn,
                        ExceptionInterceptor exceptionInterceptor)
                                       throws java.sql.SQLException

      Returns the byte[] representation of a substring of the given string (re)using a cached charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getBytesWrapped

          public static byte[] getBytesWrapped(java.lang.String s,
                               char beginWrap,
                               char endWrap,
                               SingleByteCharsetConverter converter,
                               java.lang.String encoding,
                               java.lang.String serverEncoding,
                               boolean parserKnowsUnicode,
                               ExceptionInterceptor exceptionInterceptor)
                                        throws java.sql.SQLException

      Returns the byte[] representation of the given string properly wrapped between the given char delimiters, (re)using the given charset converter, and the given encoding.
      Throws:
        `java.sql.SQLException`

    - #### getInt

          public static int getInt(byte[] buf)
                            throws java.lang.NumberFormatException

      Throws:
        `java.lang.NumberFormatException`

    - #### getInt

          public static int getInt(byte[] buf,
                   int offset,
                   int endPos)
                            throws java.lang.NumberFormatException

      Throws:
        `java.lang.NumberFormatException`

    - #### getLong

          public static long getLong(byte[] buf)
                              throws java.lang.NumberFormatException

      Throws:
        `java.lang.NumberFormatException`

    - #### getLong

          public static long getLong(byte[] buf,
                     int offset,
                     int endpos)
                              throws java.lang.NumberFormatException

      Throws:
        `java.lang.NumberFormatException`

    - #### getShort

          public static short getShort(byte[] buf)
                                throws java.lang.NumberFormatException

      Throws:
        `java.lang.NumberFormatException`

    - #### getShort

          public static short getShort(byte[] buf,
                       int offset,
                       int endpos)
                                throws java.lang.NumberFormatException

      Throws:
        `java.lang.NumberFormatException`

    - #### indexOfIgnoreCase

          public static int indexOfIgnoreCase(java.lang.String searchIn,
                              java.lang.String searchFor)

      Finds the position of a substring within a string ignoring case.
      Parameters:
        `searchIn` - the string to search in
        `searchFor` - the array of strings to search for
      Returns:
        the position where `searchFor` is found within `searchIn` starting from `startingPosition`.

    - #### indexOfIgnoreCase

          public static int indexOfIgnoreCase(int startingPosition,
                              java.lang.String searchIn,
                              java.lang.String searchFor)

      Finds the position of a substring within a string ignoring case.
      Parameters:
        `startingPosition` - the position to start the search from
        `searchIn` - the string to search in
        `searchFor` - the array of strings to search for
      Returns:
        the position where `searchFor` is found within `searchIn` starting from `startingPosition`.

    - #### indexOfIgnoreCase

          public static int indexOfIgnoreCase(int startingPosition,
                              java.lang.String searchIn,
                              java.lang.String[] searchForSequence,
                              java.lang.String openingMarkers,
                              java.lang.String closingMarkers,
                              java.util.Set<StringUtils.SearchMode> searchMode)

      Finds the position of the first of a consecutive sequence of strings within a string, ignoring case, with the option to skip text delimited by given markers or within comments.

      Independently of the `searchMode` provided, when searching for the second and following strings `SearchMode.SKIP_WHITE_SPACE` will be added and `SearchMode.SKIP_BETWEEN_MARKERS` removed.

      Parameters:
        `startingPosition` - the position to start the search from
        `searchIn` - the string to search in
        `searchFor` - the array of strings to search for
        `openingMarkers` - characters which delimit the beginning of a text block to skip
        `closingMarkers` - characters which delimit the end of a text block to skip
        `searchMode` - a `Set`, ideally an `EnumSet`, containing the flags from the enum `StringUtils.SearchMode` that determine the behavior of the search
      Returns:
        the position where `searchFor` is found within `searchIn` starting from `startingPosition`.

    - #### indexOfIgnoreCase

          public static int indexOfIgnoreCase(int startingPosition,
                              java.lang.String searchIn,
                              java.lang.String searchFor,
                              java.lang.String openingMarkers,
                              java.lang.String closingMarkers,
                              java.util.Set<StringUtils.SearchMode> searchMode)

      Finds the position of a substring within a string, ignoring case, with the option to skip text delimited by given markers or within comments.
      Parameters:
        `startingPosition` - the position to start the search from
        `searchIn` - the string to search in
        `searchFor` - the string to search for
        `openingMarkers` - characters which delimit the beginning of a text block to skip
        `closingMarkers` - characters which delimit the end of a text block to skip
        `searchMode` - a `Set`, ideally an `EnumSet`, containing the flags from the enum `StringUtils.SearchMode` that determine the behavior of the search
      Returns:
        the position where `searchFor` is found within `searchIn` starting from `startingPosition`.

    - #### split

          public static java.util.List<java.lang.String> split(java.lang.String stringToSplit,
                                               java.lang.String delimiter,
                                               boolean trim)

      Splits stringToSplit into a list, using the given delimiter
      Parameters:
        `stringToSplit` - the string to split
        `delimiter` - the string to split on
        `trim` - should the split strings be whitespace trimmed?
      Returns:
        the list of strings, split by delimiter
      Throws:
        `java.lang.IllegalArgumentException`

    - #### split

          public static java.util.List<java.lang.String> split(java.lang.String stringToSplit,
                                               java.lang.String delimiter,
                                               java.lang.String markers,
                                               java.lang.String markerCloses,
                                               boolean trim)

      Splits stringToSplit into a list, using the given delimiter
      Parameters:
        `stringToSplit` - the string to split
        `delimiter` - the string to split on
        `trim` - should the split strings be whitespace trimmed?
      Returns:
        the list of strings, split by delimiter
      Throws:
        `java.lang.IllegalArgumentException`

    - #### startsWithIgnoreCase

          public static boolean startsWithIgnoreCase(java.lang.String searchIn,
                                     int startAt,
                                     java.lang.String searchFor)

      Determines whether or not the string 'searchIn' contains the string 'searchFor', dis-regarding case starting at 'startAt' Shorthand for a String.regionMatch(...)
      Parameters:
        `searchIn` - the string to search in
        `startAt` - the position to start at
        `searchFor` - the string to search for
      Returns:
        whether searchIn starts with searchFor, ignoring case

    - #### startsWithIgnoreCase

          public static boolean startsWithIgnoreCase(java.lang.String searchIn,
                                     java.lang.String searchFor)

      Determines whether or not the string 'searchIn' contains the string 'searchFor', dis-regarding case. Shorthand for a String.regionMatch(...)
      Parameters:
        `searchIn` - the string to search in
        `searchFor` - the string to search for
      Returns:
        whether searchIn starts with searchFor, ignoring case

    - #### startsWithIgnoreCaseAndNonAlphaNumeric

          public static boolean startsWithIgnoreCaseAndNonAlphaNumeric(java.lang.String searchIn,
                                                       java.lang.String searchFor)

      Determines whether or not the string 'searchIn' contains the string 'searchFor', disregarding case,leading whitespace and non-alphanumeric characters.
      Parameters:
        `searchIn` - the string to search in
        `searchFor` - the string to search for
      Returns:
        true if the string starts with 'searchFor' ignoring whitespace

    - #### startsWithIgnoreCaseAndWs

          public static boolean startsWithIgnoreCaseAndWs(java.lang.String searchIn,
                                          java.lang.String searchFor)

      Determines whether or not the string 'searchIn' contains the string 'searchFor', disregarding case and leading whitespace
      Parameters:
        `searchIn` - the string to search in
        `searchFor` - the string to search for
      Returns:
        true if the string starts with 'searchFor' ignoring whitespace

    - #### startsWithIgnoreCaseAndWs

          public static boolean startsWithIgnoreCaseAndWs(java.lang.String searchIn,
                                          java.lang.String searchFor,
                                          int beginPos)

      Determines whether or not the string 'searchIn' contains the string 'searchFor', disregarding case and leading whitespace
      Parameters:
        `searchIn` - the string to search in
        `searchFor` - the string to search for
        `beginPos` - where to start searching
      Returns:
        true if the string starts with 'searchFor' ignoring whitespace

    - #### startsWithIgnoreCaseAndWs

          public static int startsWithIgnoreCaseAndWs(java.lang.String searchIn,
                                      java.lang.String[] searchFor)

      Determines whether or not the string 'searchIn' starts with one of the strings in 'searchFor', disregarding case and leading whitespace
      Parameters:
        `searchIn` - the string to search in
        `searchFor` - the string array to search for
      Returns:
        the 'searchFor' array index that matched or -1 if none matches

    - #### stripEnclosure

          public static byte[] stripEnclosure(byte[] source,
                              java.lang.String prefix,
                              java.lang.String suffix)

      Parameters:
        `bytesToStrip` -
        `prefix` -
        `suffix` -

    - #### toAsciiString

          public static java.lang.String toAsciiString(byte[] buffer)

      Returns the bytes as an ASCII String.
      Parameters:
        `buffer` - the bytes representing the string
      Returns:
        The ASCII String.

    - #### toAsciiString

          public static java.lang.String toAsciiString(byte[] buffer,
                                       int startPos,
                                       int length)

      Returns the bytes as an ASCII String.
      Parameters:
        `buffer` - the bytes to convert
        `startPos` - the position to start converting
        `length` - the length of the string to convert
      Returns:
        the ASCII string

    - #### wildCompare

          public static int wildCompare(java.lang.String searchIn,
                        java.lang.String searchForWildcard)

      Compares searchIn against searchForWildcard with wildcards (heavily borrowed from strings/ctype-simple.c in the server sources)
      Parameters:
        `searchIn` - the string to search in
        `searchForWildcard` - the string to search for, using the 'standard' SQL wildcard chars of '%' and '_'
      Returns:
        WILD_COMPARE_MATCH_NO_WILD if matched, WILD_COMPARE_NO_MATCH if not matched with wildcard, WILD_COMPARE_MATCH_WITH_WILD if matched with wildcard

    - #### s2b

          static byte[] s2b(java.lang.String s,
                   MySQLConnection conn)
                     throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### lastIndexOf

          public static int lastIndexOf(byte[] s,
                        char c)

    - #### indexOf

          public static int indexOf(byte[] s,
                    char c)

    - #### isNullOrEmpty

          public static boolean isNullOrEmpty(java.lang.String toTest)

    - #### stripComments

          public static java.lang.String stripComments(java.lang.String src,
                                       java.lang.String stringOpens,
                                       java.lang.String stringCloses,
                                       boolean slashStarComments,
                                       boolean slashSlashComments,
                                       boolean hashComments,
                                       boolean dashDashComments)

      Returns the given string, with comments removed
      Parameters:
        `src` - the source string
        `stringOpens` - characters which delimit the "open" of a string
        `stringCloses` - characters which delimit the "close" of a string, in counterpart order to `stringOpens`
        `slashStarComments` - strip slash-star type "C" style comments
        `slashSlashComments` - strip slash-slash C++ style comments to end-of-line
        `hashComments` - strip #-style comments to end-of-line
        `dashDashComments` - strip "--" style comments to end-of-line
      Returns:
        the input string with all comment-delimited data removed

    - #### sanitizeProcOrFuncName

          public static java.lang.String sanitizeProcOrFuncName(java.lang.String src)

      Next two functions are to help DBMD check if the given string is in form of database.name and return it as "database";"name" with comments removed. If string is NULL or wildcard (%), returns null and exits. First, we sanitize...
      Parameters:
        `src` - the source string
      Returns:
        the input string with all comment-delimited data removed

    - #### splitDBdotName

          public static java.util.List<java.lang.String> splitDBdotName(java.lang.String src,
                                                        java.lang.String cat,
                                                        java.lang.String quotId,
                                                        boolean isNoBslashEscSet)

      Next we check if there is anything to split. If so we return result in form of "database";"name" If string is NULL or wildcard (%), returns null and exits.
      Parameters:
        `src` - the source string
        `cat` - Catalog, if available
        `quotId` - quoteId as defined on server
        `isNoBslashEscSet` - Is our connection in BackSlashEscape mode
      Returns:
        the input string with all comment-delimited data removed

    - #### isEmptyOrWhitespaceOnly

          public static boolean isEmptyOrWhitespaceOnly(java.lang.String str)

    - #### escapeQuote

          public static java.lang.String escapeQuote(java.lang.String src,
                                     java.lang.String quotChar)

    - #### quoteIdentifier

          public static java.lang.String quoteIdentifier(java.lang.String identifier,
                                         java.lang.String quoteChar,
                                         boolean isPedantic)

      Surrounds identifier with quoteChar and duplicates these symbols inside the identifier.
      Parameters:
        `quoteChar` - ` or "
        `identifier` - in pedantic mode (connection property pedantic=true) identifier is treated as unquoted (as it is stored in the database) even if it starts and ends with quoteChar; in non-pedantic mode if identifier starts and ends with quoteChar method treats it as already quoted and doesn't modify.
        `isPedantic` - are we in pedantic mode
      Returns:
        With quoteChar="`":
        - null -> null
        - abc -> `abc`
        - ab`c -> `ab``c`
        - ab"c -> `ab"c`
        - `ab``c` -> `ab``c` in non-pedantic mode or ```ab````c``` in pedantic mode
        With quoteChar="\"":
        - null -> null
        - abc -> "abc"
        - ab`c -> "ab`c"
        - ab"c -> "ab""c"
        - "ab""c" -> "ab""c" in non-pedantic mode or """ab""""c""" in pedantic mode

    - #### quoteIdentifier

          public static java.lang.String quoteIdentifier(java.lang.String identifier,
                                         boolean isPedantic)

      Surrounds identifier with "`" and duplicates these symbols inside the identifier.
      Parameters:
        `identifier` - in pedantic mode (connection property pedantic=true) identifier is treated as unquoted (as it is stored in the database) even if it starts and ends with "`"; in non-pedantic mode if identifier starts and ends with "`" method treats it as already quoted and doesn't modify.
        `isPedantic` - are we in pedantic mode
      Returns:
        - null -> null
        - abc -> `abc`
        - ab`c -> `ab``c`
        - ab"c -> `ab"c`
        - `ab``c` -> `ab``c` in non-pedantic mode or ```ab````c``` in pedantic mode

    - #### unQuoteIdentifier

          public static java.lang.String unQuoteIdentifier(java.lang.String identifier,
                                           java.lang.String quoteChar)

      Trims identifier, removes quote chars from first and last positions and replaces double occurrences of quote char from entire identifier, i.e converts quoted identifier into form as it is stored in database.
      Parameters:
        `identifier` -
        `quoteChar` - ` or "
      Returns:
        - null -> null
        - abc -> abc
        - `abc` -> abc
        - `ab``c` -> ab`c
        - `"ab`c"` -> "ab`c"
        - `ab"c` -> ab"c
        - "abc" -> abc
        - "`ab""c`" -> `ab"c`
        - "ab`c" -> ab`c

    - #### indexOfQuoteDoubleAware

          public static int indexOfQuoteDoubleAware(java.lang.String searchIn,
                                    java.lang.String quoteChar,
                                    int startFrom)

    - #### toString

          public static java.lang.String toString(byte[] value,
                                  int offset,
                                  int length,
                                  java.lang.String encoding)
                                           throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### toString

          public static java.lang.String toString(byte[] value,
                                  java.lang.String encoding)
                                           throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### toString

          public static java.lang.String toString(byte[] value,
                                  int offset,
                                  int length)

    - #### toString

          public static java.lang.String toString(byte[] value)

    - #### getBytes

          public static byte[] getBytes(char[] value)

    - #### getBytes

          public static byte[] getBytes(char[] value,
                        int offset,
                        int length)

    - #### getBytes

          public static byte[] getBytes(char[] value,
                        java.lang.String encoding)
                                 throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### getBytes

          public static byte[] getBytes(char[] value,
                        int offset,
                        int length,
                        java.lang.String encoding)
                                 throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### getBytes

          public static byte[] getBytes(java.lang.String value)

    - #### getBytes

          public static byte[] getBytes(java.lang.String value,
                        int offset,
                        int length)

    - #### getBytes

          public static byte[] getBytes(java.lang.String value,
                        java.lang.String encoding)
                                 throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### getBytes

          public static byte[] getBytes(java.lang.String value,
                        int offset,
                        int length,
                        java.lang.String encoding)
                                 throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`

    - #### isValidIdChar

          public static final boolean isValidIdChar(char c)

    - #### appendAsHex

          public static void appendAsHex(java.lang.StringBuilder builder,
                         byte[] bytes)

    - #### appendAsHex

          public static void appendAsHex(java.lang.StringBuilder builder,
                         int value)

    - #### getBytesNullTerminated

          public static byte[] getBytesNullTerminated(java.lang.String value,
                                      java.lang.String encoding)
                                               throws java.io.UnsupportedEncodingException

      Throws:
        `java.io.UnsupportedEncodingException`