In your day-to-day programming activities, you must be coming across multiple situation where you need to check if a string is empty. There are various ways to do this and some use string1.equals(“”). NEVER do this. Best way to check if string is empty or not is to use length() method. This method simply return […]
The post Always Use length() Instead of equals() to Check Empty String appeared first on HowToDoInJava.