我有一个字符串:
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
<li>Milk</li>
<li>Milk</li>
<li>Milk</li>
<li>Milk last</li>
我想对所有 li-tags 进行交互(以便在标签之间添加一些文本):
for (char c: innerText.toCharArray()) {
if(c == '<'){
// process the text but in this way
//I iterate over whole text as a one line
}
}