org.eclipse.net4j.util

## Class StringUtil

- java.lang.Object
- - org.eclipse.net4j.util.StringUtil

-     public final class StringUtil
      extends Object

  Various static helper methods for dealing with strings.
  Author:
    Eike Stepper

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EMPTY`
    `static String` | `NL`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `cap(String str)`
    `static String` | `capAll(String str)`
    `static int` | `compare(String s1, String s2)`
    `static String` | `create(char c, int length)`
    `static boolean` | `equalsUpperOrLowerCase(String s, String upperOrLowerCase)`
    `static String` | `formatException(Throwable t)`
    `static boolean` | `glob(String pattern, String string)` Matches a string against a pattern.
    `static boolean` | `glob(String pattern, String string, String[] subStrings)` Matches a string against a pattern and fills an array with the sub-matches.
    `static boolean` | `isEmpty(String str)`
    `static int` | `occurrences(String str, char c)`
    `static int` | `occurrences(String str, String c)`
    `static String` | `replace(String text, String[] find, String[] replace)`
    `static String` | `safe(String str)`
    `static String` | `safe(String str, String def)`
    `static List<String>` | `split(String text, String separators, String brackets)`
    `static String` | `uncap(String str)`
    `static String` | `uncapAll(String str)`

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

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

- - ### Field Detail

    - #### EMPTY

          public static final String EMPTY

      See Also:
        Constant Field Values

    - #### NL

          public static final String NL

  - ### Method Detail

    - #### create

          public static String create(char c,
                                      int length)

      Since:
        3.4

    - #### formatException

          public static String formatException(Throwable t)

      Since:
        2.0

    - #### replace

          public static String replace(String text,
                                       String[] find,
                                       String[] replace)

    - #### split

          public static List<String> split(String text,
                                           String separators,
                                           String brackets)

      Since:
        3.4

    - #### safe

          public static String safe(String str)

    - #### safe

          public static String safe(String str,
                                    String def)

      Since:
        3.4

    - #### compare

          public static int compare(String s1,
                                    String s2)

    - #### equalsUpperOrLowerCase

          public static boolean equalsUpperOrLowerCase(String s,
                                                       String upperOrLowerCase)

      Since:
        3.1

    - #### capAll

          public static String capAll(String str)

      Since:
        2.0

    - #### cap

          public static String cap(String str)

    - #### uncapAll

          public static String uncapAll(String str)

      Since:
        2.0

    - #### uncap

          public static String uncap(String str)

    - #### occurrences

          public static int occurrences(String str,
                                        char c)

    - #### occurrences

          public static int occurrences(String str,
                                        String c)

    - #### isEmpty

          public static boolean isEmpty(String str)

    - #### glob

          public static boolean glob(String pattern,
                                     String string)

      Matches a string against a pattern.

      Pattern description:

      - `*` matches 0 or more characters
      - `?` matches a single character
      - `[...]` matches a set and/or range of characters
      - `\` escapes the following character
      Since:
        2.0

    - #### glob

          public static boolean glob(String pattern,
                                     String string,
                                     String[] subStrings)

      Matches a string against a pattern and fills an array with the sub-matches.

      Pattern description:

      - `*` matches 0 or more characters
      - `?` matches a single character
      - `[...]` matches a set and/or range of characters
      - `\` escapes the following character
      Since:
        2.0

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html