Class StringUtils

java.lang.Object
com.jbstrap.core.utils.StringUtils

public final class StringUtils extends Object
Class containing methods that makes handling String values easier.
Since:
4.0
Author:
JBStrap
  • Method Details

    • subString

      public static String subString(String source, String regexpPattern)
      Gets a sub String from the specified source, using the specified pattern.
      Parameters:
      source - The source String
      regexpPattern - The regexp pattern
      Returns:
      The first result that matches the pattern, or null, if none are found
    • getToken

      public static String getToken(String source, String delimiter, Integer index)
      Gets a token, according to the specified parameters.
      Parameters:
      source - The source String
      delimiter - The delimiter character, used to separate.
      index - The index of the desired string. If specified as null the method will return with the first value.
      Returns:
      The value, corresponding to the specified index, or null, if not found