title: Java Inner Text (getTextContents()) Problem
body: <p>I'm trying to do some parsing in Java and I'm using Cobra HTML Parser to get the HTML into a DOM then I'm using XPath to get the nodes I want. When I get down to the desired level I call node.getTextContents(), but this gives me a string like</p>
  
  <pre><code>"\n\n\nValue\n-\nValue\n\n\n"
  </code></pre>
  
  <p>Is there a built in way to get rid of the line breaks? I would like to do a RegEx like</p>
  
  <pre><code>(?:\s*([^-]+)\s*-\s*([^-]+)\s*)
  </code></pre>
  
  <p>on the inner text and would really prefer not to have to deal with the possible different white space symbols in between the text.</p>
  
  <p>Example Input:</p>
  
  <pre><code>Value
  -
  Value
  </code></pre>
  
  <p>Thanks</p>