如何拆分以下字符串
String str = "(obj.userAge EQUALS 51) AND (obj.userAddress CONTAINS STREET1)";
所以我应该得到
string 1 = "obj.userAge EQUALS 512";
string 2 = "obj.userAddress CONTAINS STREET1";
我试过了
str.split("AND")
但我需要不带括号的字符串
有时我可以从数据库中获取一个字符串,例如
String str = "(obj.userAge EQUALS 51) AND (obj.userAddress CONTAINS STREET1) OR (obj2.salary >= 3000)";
所以现在OR
添加。