I just announced the new Spring Boot 2 material, coming in REST With Spring:

>> CHECK OUT THE COURSE

The method replaceAll() replaces all occurrences of a String in another String.

Available Signatures

public String replaceAll(String regex, String replacement)

Example

@Test
public void whenCallReplace_thenCorrect() {
    String s = "I learn Spanish";
    
    assertEquals("I learn French", s.replaceAll("Spanish", "French"));
}
Next »
Java String.split()
« Previous
Java String.replace()

I just announced the new Spring Boot 2 material, coming in REST With Spring:

>> CHECK OUT THE LESSONS