Java Top

The early-bird price of the new Learn Spring Security OAuth course packages will increase by $50 tomorrow:

>> CHECK OUT THE COURSE

The method trim() removes any whitespace at the beginning and at the end of a String. If the String contains only spaces, then the method returns an empty String.

Available Signatures

public String trim()

Example

@Test
public void whenTrim_thenCorrect() {
    assertEquals("foo", " foo  ".trim());
}
Next »
Java String.valueOf()
« Previous
Java String.toUpperCase()
Java bottom

The early-bird price of the new Learn Spring Security OAuth course packages will increase by $50 tomorrow:

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