Java StringisEmpty() Method
Example
Find out if a string is empty or not:
String myStr1 = "Hello";String myStr2 = "";System.out.println(myStr1.isEmpty());System.out.println(myStr2.isEmpty());Definition and Usage
TheisEmpty() method checks whether a string is empty or not.
This method returns true if the string is empty (length() is 0), and false if not.
Syntax
public boolean isEmpty()Parameters
None.
Technical Details
| Returns: | Aboolean value:
|
|---|
❮ String Methods

