String doubleSpace = " ";
String news = "The cat jumped. The dog did not.";
while (news.contains(doubleSpace) = true)
{
news=news.replaceAll(" ", " ");
}
The above will not compile, giving the error "unexpected type. required:variable, found:value" I do not understand why, as String.contains() should return a boolean value.