- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Checking for Null or Empty in Java.
We can check whether a particular String is empty or not, using isBlank() method of the StringUtils class. This method accepts an integer as a parameter and returns true if the given string is empty, or false if it is not.
Example
import org.apache.commons.lang3.StringUtils; public class Sample { public static void main(String args[]) { String str = ""; Boolean bool = StringUtils.isBlank(str); System.out.println(bool); } }
Output
true
- Related Articles
- Checking for Null or Empty or White Space Only String in Java.
- Check if a String is empty ("") or null in Java
- MongoDB checking for not null?
- Set a custom value for NULL or empty values in MySQL
- Check for NULL or empty variable in a MySQL stored procedure
- Check if a String is whitespace, empty ("") or null in Java
- Java Program to Check if a String is Empty or Null
- Java program to find whether the given string is empty or null
- How to test String is null or empty?
- Which one is better in MySQL - NULL or empty string?
- Check whether a field is empty or null in MySQL?
- How to check if field is null or empty in MySQL?
- Different ways of checking if an array is empty or not in PHP
- MongoDB query which represents not equal to null or empty?
- Which one is better to insert NULL or empty string in MySQL?

Advertisements