Given a string str, the task is to check if this string is empty or not, in Java.
Input: str = "" Output: True Input: str = "GFG" Output: False
- Get the String to be checked in str
- We can simply check if the string is empty or not using the isEmpty() method of String class
- Print true if the above condition is true. Else print false.
Below is the implementation of the above approach:
Is string "GeeksforGeeks" empty? false Is string "" empty? true
- String slicing in Python to check if a string can become empty by recursive deletion
- Check if a string can become empty by recursively deleting a given sub-string
- Program to check if the String is Null in Java
- Java program to check whether a string is a Palindrome
- Program to check if a String in Java contains only whitespaces
- C Program to Check if a Given String is Palindrome
- Python program to check if given string is pangram
- Program to check if input is an integer or a string
- Python program to check if a string is palindrome or not
- Program to check if first and the last characters of string are equal
- Python program to check if a string contains all unique characters
- Python program to check if given string is vowel Palindrome
- Count of non-empty sequences of a String
- Operations required to make the string empty
- Check for string rotation in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.