如何解析html字符串,将文本和图片链接顺序放进列表?
发布网友
发布时间:2022-05-05 03:46
我来回答
共1个回答
热心网友
时间:2022-06-29 01:55
给你一个简单的思路,然后具体需求你扩展一下方法应该就可以了
public
static
void
test()
{
String
str
=
"
ssssssssssssssssssssssssssssss
"
+
"
dddddddddddddddddddddddddddddd
"
+
"
ffffffffffffffffffffffffffffff
"
+
"gggggggg,
"
+
"
"
+
"
"
+
"
"
+
"
"
+
"
"
+
"
"
+
"
";
String
strs
=
str.split("[^>]*(?=)");
System.out.println(Arrays.toString(strs));
}