CharSequence isEmpty Method

isEmpty() method added in CharSequence class as a default methid in jdk 15.


isEmpty method:

default boolean isEmpty()
Returns true if this character sequence is empty.
Implementation Requirements:
The default implementation returns the result of calling length() == 0.
Returns:
true if length() is 0, otherwise false

Example:

CharSequence ch = ///Object

if(ch.isEmpty()){
//return true if empty
}

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept