Class StringUtil


  • public class StringUtil
    extends Object
    • Method Detail

      • join

        public static String join​(String separator,
                                  String... keys)
        Joins the given keys with the separator.
      • split

        public static String[] split​(String str,
                                     char separator,
                                     int max)
        Splits the given string with the separator, returns an array with the given max length. When max <= 0, no limit is applied.
      • sanitizeStringValue

        public static String sanitizeStringValue​(String value,
                                                 int maxLength)
        Sanitizes a string value.
        • Truncate characters after the first null character as it is reserved as the padding character
        • Limit the length of the string
        Parameters:
        value - String value to sanitize
        maxLength - Max number of characters allowed
        Returns:
        Modified value, or value itself if not modified