Class Strings


  • public class Strings
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Strings()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isNotBlank​(java.lang.String s)
      Check whether the passed String is not null and not empty (after trim)
      static java.lang.String join​(java.util.List<java.lang.String> strings, char c)
      Join a string on a character.
      static byte[] nullTerminatedBytes​(java.lang.String s)
      Return a byte[] of the String including a final null terminator
      static java.util.List<java.lang.String> split​(java.lang.String string, char c)
      Split a string on a character.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Strings

        public Strings()
    • Method Detail

      • split

        public static java.util.List<java.lang.String> split​(java.lang.String string,
                                                             char c)
        Split a string on a character.
        Parameters:
        string - The string to split.
        c - The character to split on.
        Returns:
        The splitted parts of the string.
      • join

        public static java.lang.String join​(java.util.List<java.lang.String> strings,
                                            char c)
        Join a string on a character.
        Parameters:
        strings - The strings to join.
        c - The character to join on.
        Returns:
        The joined parts of the string.
      • nullTerminatedBytes

        public static byte[] nullTerminatedBytes​(java.lang.String s)
        Return a byte[] of the String including a final null terminator
        Parameters:
        s -
        Returns:
      • isNotBlank

        public static boolean isNotBlank​(java.lang.String s)
        Check whether the passed String is not null and not empty (after trim)
        Parameters:
        s - The string to check
        Returns:
        true iff the string is not blank