public final class TextUtils extends Object
| Modifier and Type | Method and Description | 
|---|---|
| static boolean | containsBlanks(CharSequence s) | 
| static boolean | isBlank(CharSequence s)Checks if a CharSequence is empty (""), null or whitespace only. | 
| static boolean | isEmpty(CharSequence s)Returns true if the parameter is null or of zero length | 
| static int | length(CharSequence cs)Gets a CharSequence length or  0if the CharSequence isnull. | 
| static String | toHexString(byte[] bytes)Returns a hexadecimal string with lowercase letters, representing the
 values of the  bytes. | 
public static boolean isEmpty(CharSequence s)
public static boolean isBlank(CharSequence s)
Checks if a CharSequence is empty (""), null or whitespace only.
Whitespace is defined by Character.isWhitespace(char).
 TextUtils.isBlank(null)      = true
 TextUtils.isBlank("")        = true
 TextUtils.isBlank(" ")       = true
 TextUtils.isBlank("abg")     = false
 TextUtils.isBlank("  abg  ") = false
 s - the CharSequence to check, may be nulltrue if the CharSequence is null, empty or whitespace onlypublic static int length(CharSequence cs)
0 if the CharSequence is
 null.cs - a CharSequence or null0 if the CharSequence is
         null.public static boolean containsBlanks(CharSequence s)
public static String toHexString(byte[] bytes)
bytes.bytes - whose hex string should be createdCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.