Hi
Im wondering what is the standard way to test if a string is empty. For example the string returned from the table is from a blank cell, the string is 'empty'
aString = (String)table.getValueAt(x,y);
aString.trim();
if (aString.equals(null)) { System.out.println("tis null"); }
if (aString.equals("")) { System.out.println("tis empty"); }
if (aString == null) { System.out.println("tis null =="); }
if (aString == "") { System.out.println("tis empty =="); }
Looking at the api for string it seems the best method is to use length(). A string with 1 character is length 2. Is this safe or may i get caught out doing this ?