Using isEmpty from String class : XML Registry « XML « Java
- Java
- XML
- XML Registry
Using isEmpty from String class
public class StringDemo {
public static void main(String[] args) {
String myString = "";
if (myString.isEmpty()) {
System.out.println("Empty");
} else {
System.out.println("Not empty");
}
}
}
//Empty
Related examples in the same category