0
我很奇怪,为什么if语句不被评估为true第二...HTML标记比较
while ((tmp = yearReader.readLine()) != null) {
if(tmp.length() >= 22){
System.out.println(tmp.substring(0, 12));
if(tmp.substring(0, 12) == "<li><a href="){
System.out.println("This should print...");
}
}
}
打印此...
<li><a href=
<li><a href=
<li><a href=
简短回答:使用'equals'而不是'=='。 –
工作。谢谢。 –