#Use String#isEmpty()
Use String#isEmpty()
To check if a String is empty, you could use either of these:
s.length()<1 // 12 bytes s.equals("") // 12 bytes However, using .isEmpty() is one byte shorter:
s.isEmpty() // 11 bytes Note that for Lists it's still shorter to check the size instead of using isEmpty():
l.size()<1 // 10 bytes l.isEmpty() // 11 bytes