去掉左边控格
function LTrim(str){
if ((typeof(str) != "string") || !str) return "";
return str.replace(/(^\s*)/g, "");
}
去掉右边控格
function RTrim(str){
if ((typeof(str) != "string") || !str) return "";
return str.replace(/(\s*$)/g, "");
}
去掉左右两边控格
function trimStr(str){
if ((typeof(str) != "string") || !str) return "";
return str.replace(/(^\s*)|(\s*$)/g, "");
}
function LTrim(str){
if ((typeof(str) != "string") || !str) return "";
return str.replace(/(^\s*)/g, "");
}
去掉右边控格
function RTrim(str){
if ((typeof(str) != "string") || !str) return "";
return str.replace(/(\s*$)/g, "");
}
去掉左右两边控格
function trimStr(str){
if ((typeof(str) != "string") || !str) return "";
return str.replace(/(^\s*)|(\s*$)/g, "");
}