The cat sat on the mat.
myText = myText.trim().replace(" "," ");
myText.trim().replaceAll("\\s+"," ");