Not sure what you mean by \\s
it's since you're not using regular expressions there. The following check should work:
String comment = dogParkProgramMain.infoVector.elementAt(x).getComment();
if (comment == null || comment.trim().isEmpty()) {
System.out.println("Blank");
}
trim()
function will remove all leading and trailing spaces from the string meaning that if your string only contains spaces it would end up empty after trim
. This code will check for any number of spaces as opposed to only one space mentioned in your question.