Class TextUtils


  • public final class TextUtils
    extends Object
    A couple of String helpers.
    • Constructor Detail

      • TextUtils

        public TextUtils()
    • Method Detail

      • isEmpty

        public static boolean isEmpty​(CharSequence s)
      • isBlank

        public static boolean isBlank​(CharSequence s)
      • getString

        public static String getString​(byte[] data,
                                       int offset,
                                       int length,
                                       String charset)
        Converts the byte array of characters to a string. If the specified charset is not supported, default system encoding is used.
        Parameters:
        data - the byte array to be encoded
        offset - the index of the first byte to encode
        length - the number of bytes to encode
        charset - the desired character encoding
        Returns:
        The result of the conversion.
      • getBytes

        public static byte[] getBytes​(String data,
                                      String charset)
        Converts the specified string to a byte array. If the charset is not supported the default system charset is used.
        Parameters:
        data - the string to be encoded
        charset - the desired character encoding
        Returns:
        The resulting byte array.