Class SplitStringExtensions

java.lang.Object
io.github.astrapi69.string.SplitStringExtensions

public final class SplitStringExtensions extends Object
The class SplitStringExtensions provides methods for split string objects.

  • Method Details

    • splitToWordsAndCount

      public static Map<String,Integer> splitToWordsAndCount(String input)
      Splits the given input string into words and puts them to a counter map
      Parameters:
      input - The input string
      Returns:
      The map with the words and the count
    • splitToWordsAndCount

      public static Map<String,Integer> splitToWordsAndCount(String input, String[] findString)
      Splits the given input string into words and puts them to a counter map
      Parameters:
      input - The input string
      findString - An array with search patterns.
      Returns:
      The map with the words and the count
    • splitToWordsAndCount

      public static Map<String,Integer> splitToWordsAndCount(String input, String regex)
      Splits the given input string into words and puts them to a counter map
      Parameters:
      input - The input string
      regex - The regex string that is used for splitting
      Returns:
      The map with the words and the count
    • getTripleFromMessage

      public static org.apache.commons.lang3.tuple.Triple<String,String,String> getTripleFromMessage(String message)
      Splits the given message string into three parts and put them into a Triple object
      Parameters:
      message - The message string
      Returns:
      The splitted message in a Triple object