String kosong simpul

if (!a.trim()) {
    // is empty or whitespace
}
Amused Ape