Module io.ebean.api
Package io.ebean.util

Class StringHelper


public final class StringHelper extends Object
Utility String class that supports String manipulation functions.
  • Constructor Details

    • StringHelper

      public StringHelper()
  • Method Details

    • isNull

      public static boolean isNull(String value)
      Return true if the value is null or an empty string.
    • delimitedToMap

      public static Map<String,String> delimitedToMap(String source, String listDelimiter, String nameValueSeparator)
      Parses out a list of Name Value pairs that are delimited together. Will always return a StringMap. If allNameValuePairs is null, or no name values can be parsed out an empty StringMap is returned.
      source - the entire string to be parsed.
      listDelimiter - (typically ';') the delimited between the list
      nameValueSeparator - (typically '=') the separator between the name and value
    • replace

      public static String replace(String source, String match, String replace)
      This method takes a String and will replace all occurrences of the match String with that of the replace String.
      source - the source string
      match - the string used to find a match
      replace - the string used to replace match with
      the source string after the search and replace
    • removeNewLines

      public static String removeNewLines(String source)
      Return new line and carriage return with space.
    • splitNames

      public static String[] splitNames(String names)
      Splits at any whitespace "," or ";" and trims the result. It does not return empty entries.