js如何将数组转换成SQL可以处理的字符串
//数组为Array [ "AI", "INPUT", "MI", "OOB" ]
String[] str=new String[]{"AI", "INPUT", "MI", "OOB"};
String result1= "";
for (i = 0; i < array.length; i++) {
result1 = result1 + "\'" + array[i] + "\'" + ",";//此操作后的result1=“\'AI\',\'INPUT\',\'MI\',\'OOB\',”
}
result1 = result1.substring(0, result1.length - 1); //此操作后的result1=“\'AI\',\'INPUT\',\'MI\',\'OOB\'”(去掉最后一位字符)