String s = "[clientname: wangzhen][method: abcd]";
String news = s.substring(s.indexOf("method")+ "method: ".length(), s.indexOf("]", s.indexOf("method")) );
System.out.println(s);输出: abcd
此处使用了public int indexOf(String str, int fromIndex)
String s = "[clientname: wangzhen][method: abcd]";
String news = s.substring(s.indexOf("method")+ "method: ".length(), s.indexOf("]", s.indexOf("method")) );
System.out.println(s);输出: abcd
此处使用了public int indexOf(String str, int fromIndex)

被折叠的 条评论
为什么被折叠?