String a ="((booktime >= '2019-01-29 11:10:59' and booktime <= '2019-01-29 23:59:59') AND billno = '  111 ' AND soid = '11122') and isnull(dr, 0)=0 and processstatus <>-2 and processstatus <>'-1' and processstatus <>'0'  and esoc_order.pk_group='0001A210000000000K2M' and esoc_order.pk_org in ('0001A210000000000CCT')";

String[] strArr = a.split("'");

StringBuffer b=new StringBuffer();

for(int i=0;i<strArr.length;i++){

String str = strArr[i];

System.out.println(str);

if((i&1) != 1){//是偶数

b.append(str).append("'");//不去空格

}else{

b.append(str.trim()).append("'");//去空格

}

}

String newSqlWhere = b.toString();

if(newSqlWhere.length()>0){

newSqlWhere=newSqlWhere.substring(0, newSqlWhere.length()-1);

}

if(a.equals(newSqlWhere)){

System.out.println("相等");

}else{

System.out.println("不等");

System.out.println(newSqlWhere);

}


友情链接
ioDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信