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) + " ";
}
精彩评论