← Back to Gists

short usefull code

📝 Java
mklein
mklein · Level 7 ·

This Java snippet checks if a string is null or empty in a single line.

Java
public static boolean isNullOrEmpty(String str) { return str == null || str.isEmpty();
}

Comments

No comments yet. Start the discussion.