开发者

Android, parsing html, problem with strings in strings

Im trying to parse some html code line by line. However, when i search for a line that start with <td class="departure", i cant manage to syntax it correctly because of the string delimiter signs (") (what is the name of this sign in english anyway?) in the html. It sees two strings and departure as a variable in开发者_StackOverflow社区 between.

Can anyone help me with this?

if (line.startsWith("   <td class="departure"")){

   result += Html.fromHtml(line) + " ";
}


Escape that character (it's called quotes) by using \:

if (line.startsWith("   <td class=\"departure\"")){

   result += Html.fromHtml(line) + " ";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜