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()
Course – LS – All

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

>> CHECK OUT THE COURSE
res – REST with Spring (eBook) (everywhere)
Comments are closed on this article!