关于字符串分割的 有一字符串"select * from test where id=1"我想把"test"和"where id=1"分出来,放到两个参数里面,要怎么分啊?
------解决方案--------------------
Java code
String sql = "select * from test where id = 1 and name = 77";
String[] s = sql.split(" from ")[1].split(" ", 2);
for (String a : s) {
System.out.println(a);
}
------解决方案--------------------