Class StringFunctions


  • public class StringFunctions
    extends Object
    • Constructor Detail

      • StringFunctions

        public StringFunctions()
    • Method Detail

      • decompose

        @Nullable
        public static String decompose​(@CheckForNull
                                       String s)
      • filterFilename

        @Nullable
        public static String filterFilename​(@CheckForNull
                                            String input)
      • filterName

        @Nonnull
        public static String filterName​(@Nonnull
                                        String input)
        removes anything from the text that is not alphanumeric
        Parameters:
        input - any inputtext
        Returns:
        the text with everything but Alphanumerics and spaces stripped
      • generateRandomKey

        @Nonnull
        public static String generateRandomKey()
        Generate random key.
        Returns:
        the string
      • generateRandomKey

        @Nonnull
        public static String generateRandomKey​(int len)
        Generate random key.
        Returns:
        the string
      • replaceEverythingButNumbers

        @Nonnull
        public static String replaceEverythingButNumbers​(@Nonnull
                                                         String text)
      • toCamelCase

        @Nullable
        public static String toCamelCase​(@CheckForNull
                                         String input)
        camelcases the input, ie "to camel case" will yield "toCamelCase"
        Parameters:
        input - the string to camelcase
        Returns:
        the camelcased string
      • trim

        @Nullable
        public static String trim​(@CheckForNull
                                  String input)
        trims away space and comma at the beginning and end and also removes double spacing
        Parameters:
        input - the input to trim
        Returns:
        the trimmed input
      • trim

        @Nullable
        public static String trim​(@CheckForNull
                                  String input,
                                  char[] chrs)
        trims away any given characters, also removes double spaces
        Parameters:
        input - the input
        chrs - the array of characters to remove
        Returns:
        the trimmed input
      • trimDoubleSpaces

        @Nonnull
        public static String trimDoubleSpaces​(@Nonnull
                                              String input)
        trims away double spaces
        Parameters:
        input - the input to trim
        Returns:
        the trimmed string
      • identical

        public static boolean identical​(Set<String> set,
                                        String[] list)