//JS去掉前后空格函数
function cTrim(sInputString,iType){
var sTmpStr = ' ';
var i = -1;
if(iType == 0 || iType == 1)
{
while(sTmpStr == ' '){
++i;
sTmpStr = sInputString.substr(i,1);
}
sInputString = sInputString.substring(i);
}
if(iType == 0 || iType == 2)
{
sTmpStr = ' ';
i = sInputString.length;
while(sTmpStr == ' '){
--i;
sTmpStr = sInputString.substr(i,1);
}
sInputString = sInputString.substring(0,i+1);
}
return sInputString;
}
//判断是否为数字
function is_numeric(num) {
var reg = /^\-?([1-9]\d*|0)(\.\d+)?$/;
if( reg.test(num) ){
return true;
}else{
return false;
}
}
function cTrim(sInputString,iType){
var sTmpStr = ' ';
var i = -1;
if(iType == 0 || iType == 1)
{
while(sTmpStr == ' '){
++i;
sTmpStr = sInputString.substr(i,1);
}
sInputString = sInputString.substring(i);
}
if(iType == 0 || iType == 2)
{
sTmpStr = ' ';
i = sInputString.length;
while(sTmpStr == ' '){
--i;
sTmpStr = sInputString.substr(i,1);
}
sInputString = sInputString.substring(0,i+1);
}
return sInputString;
}
//判断是否为数字
function is_numeric(num) {
var reg = /^\-?([1-9]\d*|0)(\.\d+)?$/;
if( reg.test(num) ){
return true;
}else{
return false;
}
}