1. 前段时间遇到 存储过程传值时, 把 “” 变成 “ ”
在 Sql server 里 借助 正则表达式,比较麻烦。 写程序同样。
借助 FireBug 。
$(["@UserId","@Company","@Project","@Building","@Room","@Reporter","@Phone","@PageIndex","@PageSize","@OrderField","@Order"]).each(function(i,d){
console.log(" set " + d + " = ltrim( IsNull(" + d + " ,'') );" ) ;
}) ;
会生成:
set @UserId = ltrim( IsNull(@UserId ,'') );
set @Company = ltrim( IsNull(@Company ,'') );
set @Project = ltrim( IsNull(@Project ,'') );
set @Building = ltrim( IsNull(@Building ,'') );
set @Room = ltrim( IsNull(@Room ,'') );
set @Reporter = ltrim( IsNull(@Reporter ,'') );
set @Phone = ltrim( IsNull(@Phone ,'') );
set @PageIndex = ltrim( IsNull(@PageIndex ,'') );
set @PageSize = ltrim( IsNull(@PageSize ,'') );
set @OrderField = ltrim( IsNull(@OrderField ,'') );
set @Order = ltrim( IsNull(@Order ,'') );
2. 输出 utf8 编码与字符:
var res = ""; for(var i=1000;i< 3000 ;i++){ res += i + "\t:" + unescape ( "%u" + i ) +"\t\t" ; } res