I'm reading XML data using Java and DOM. When I print a variable to the console I notice it prints on two different lines.
Output:
Hello How are
you today?
When I go to the attribute I'm trying to print of the underlying XML document, I notice the following:
<element attribute = "Hello How are
you today?"></element>
How do I remove the characters 
 from the attribute value in Java?
If the data from the attribute is stored in a Java String variable called myVar, I tried the following unsuccessfully:
if(myVar.contains("
")){
myVar = myVar.replaceAll("
", " ");
}