我想从内容中提取某个内容,没法用sql,只能通过代码来实现
比如:下面截图里面我想提取编辑的值 入截图的:江亚蔓

有没有好的办法?
我想从内容中提取某个内容,没法用sql,只能通过代码来实现
比如:下面截图里面我想提取编辑的值 入截图的:江亚蔓

有没有好的办法?
可以使用正则表达式或者直接使用字符串截取。需要我可以帮你写:
String editor = null;
try {
editor = str.substring(str.indexOf("编辑:")+3);
editor = editor.substring(0,editor.indexOf("\n"));
} catch (Exception e) {
// TODO: handle exception
}
if(editor!=null) {
System.out.println("已找到编辑的名字:"+editor.trim());
}else {
System.out.println("未找到编辑的名字");
}
运行:
