isEmpty, startswith and endsWith

isEmpty This method is used to check whether string has any characters in it or its empty string. It returns true if length of a string is zero and false otherwise. Method signature public boolean isEmpty() public boolean isEmpty() Example public class StringEmptyExample{   public static void main(String args[]){   String s1="";   String s2="java"; […]

Share this article on