Java Top

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

>> CHECK OUT THE COURSE

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

Available Signatures

public boolean isEmpty()

Example

@Test
public void whenCallIsEmpty_thenCorrect() {
    String s1 = "";
    
    assertTrue(s1.isEmpty());
}
Next »
Java String.lastIndexOf()
« Previous
Java String.intern()
Java bottom

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

>> CHECK OUT THE COURSE
Comments are closed on this article!