<<< String compareToIgnoreCase( ) example | Index | String limitations >>> |
Code that uses the isEmpty method:
String customerNumber = ""; //if ( customerNumber.equals("") ) // old way //if ( customerNumber.length() == 0 ) // old way if ( customerNumber.isEmpty() ) { // Java 1.6+ System.out.println( "customerNumber contains an empty string."); }
<<< String compareToIgnoreCase( ) example | Index | String limitations >>> |