我真的停留在这个异常字符串索引越界异常中
private static void getUserComment(String s) {
while(s.contains("author'>")){
System.out.println(s.substring(s.indexOf("author'>"),
s.indexOf("<div id='")));
s = s.substring(0, s.indexOf("author'>")) +
s.substring(s.indexOf("<div id='"+9));
}
}
你的输入字符串是什么样的? – Mat
哪一行导致异常? – Arjan
打印和子字符串语句都会产生这个异常 – Nayef