xml - Java Inner Text (getTextContents()) Problem -


I am trying to parse something in Java and I am using the Cobra HTML Parser so that HIM can get a DOM I'm using XPath to get the nodes. I call node.gettextContents () when I get to the desired level, but it should

  "\ N \ n \ nValue \ n- \ nValue \ n \ n \ n"  

what to do to get rid of the line breaks Ta remains? I would like to do a RegEx such as

  (?: \ S * ([^ -] +) \ s * - \s * ([^ -] +) \ s *)  

happens on the inner text and in fact does not want to deal with possible white space symbols in the middle of the text.

Example input:

  value - value  

thanks

.

  The string has been trimed = original_string.values ​​("\ n", "");  

The first argument is a regular expression: You can change the block with all forceps in the original string with replaceAll ("\\ s +", "") For example.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -