string.isEmpty()

String.isEmpty() Checks if the string is empty or not.
Syntax
String1.isEmpty(String2)
Return value is boolean ( true or false )

Here are some examples with output.
String str1 = "";  
String str2 = "plus2net"; 

System.out.println(str1.isEmpty()); // true
System.out.println(str2.isEmpty()); // false

Checking a null string

It returns exception.
String str3=null;
System.out.println(str3.isEmpty());
Exception in thread "main" java.lang.NullPointerException

All String functions


plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer