function ltrim(str) {
var pattern = new RegExp("^[\\s]+","gi");
return str.replace(pattern,"");
}
function rtrim(str) {
var pattern = new RegExp("[\\s]+$","gi");
return str.replace(pattern,"");
}
function trim(str) {
return rtrim(ltrim(str));
}
posted on 2006-11-18 14:35
robbin163 阅读(508)
评论(0) 编辑 收藏