截取双引号之间的内容
<dl id="r_611818" style='display:block'>想要从上边的字符串截取出r_611818
具体步骤如下
String movie_id = movie_id_str.substring(movie_id_str.indexOf("\"") + 3, getCharacterPosition(movie_id_str));
private static int getCharacterPosition(String string) { Matcher slashMatcher = Pattern.compile("\"").matcher(string); int mIdx = 0; while (slashMatcher.find()) { mIdx++; if (mIdx == 2) { break; } } return slashMatcher.start(); }
其中movie_id_str就是上边想要截取的字符串