// 处理单引号
public static String getSQL(String s) {
if (s != null) {
s = s.replaceAll("'", "''");
}
return s;
}
// 处理单引号和双引号,例如:"Test"问题'
public static String getScriptString(String s) {
if (s != null) {
s = s.replaceAll("/'", "'").replaceAll("/"", "/"");
}
return s;
}
sql脚本和js中使用字符串的处理
最新推荐文章于 2024-08-26 07:22:47 发布