I have a String like this
"<xxxxxx125xxxx>
<yy2yy>2</yy2yy>
<yy3yy>3</yy3yy>
<yyhhhhyy>50</yyyyy>
<yyyyy>123</yyyyy>"
How can I have an output like:
2 3 50 123
Well, i'm using Android, but I think that it's a global regex right?
I have a String like this
"<xxxxxx125xxxx>
<yy2yy>2</yy2yy>
<yy3yy>3</yy3yy>
<yyhhhhyy>50</yyyyy>
<yyyyy>123</yyyyy>"
How can I have an output like:
2 3 50 123
Well, i'm using Android, but I think that it's a global regex right?
Simply use <[^>]+>
regex.
String[] string = new String[] { "<yy2yy>2</yy2yy>", "<yy3yy>3</yy3yy>",
"<yyhhhhyy>50</yyyyy>", "<yyyyy>123</yyyyy>" };
for (String s : string) {
System.out.println(s.replaceAll("<[^>]+>", ""));
}
output:
2
3
50
123