I would like to change Newline and location with my counterparts so that they can style correctly in my Android app.
I would like to know the best way to get this regex I But it was not working So what I want to achieve: to You can do this in Java call 2: I have used the In addition to this, @ AMN has commented that you have your string & lt; Br / & gt; :
has tried to do this to replace Newline with string.replaceAll ("@
. * \\ n * * Lt; / Code & gt; @si ","
\ n < / Code> to
& lt; Br / & gt; , and "double unloaded space" from
& amp; Emsp; .
< Code> string = string.replaceAll ("\\ r? \\ n", " & quot;); String = string Location ("", "& amp; emsp;"); Edit
:
Matcher m = Pattern.compile ("(? S) (? I) (? & Lt; = & lt; code & Gt;) (?? +) (= & Lt;? / Code & gt ;.) ") matching (string); Stringbuffer buff = new stringbuffer (); While (m.find ()) {string grp = m.group (1) .replaceAll ("\\ r? \\ n", "
tags and can avoid these replacements.
No comments:
Post a Comment