JavaStringisBlank

Returns true if the string is empty or contains only whitespace (Java 11+).

Syntax

str.isBlank()