Java String.isEmpty()

The method isEmpty() is a convenience method that checks if the size of a String is equal to zero.

Available Signatures

[source,java,gutter:,false]

public boolean isEmpty()

Example

[source,java,gutter:,true]

@Test
public void whenCallIsEmpty_thenCorrect() {
    String s1 = "";

    assertTrue(s1.isEmpty());
}