Leerzeichen Ersetzen Java

String text = "This is a sentence.";

String newtext = text.replace(" ", "+");

System.out.println(newtext);
Dead Dog