标签:
<script type="text/javascript">
function is_blank(str){
var reg = /^\s+$/;
return reg.test(str);
}
function del_blank(str){
var reg = /\s+/g;
return str.replace(reg,"");
}
var str_1 = " ";
var str_2 = "aa dd gg da";
alert(is_blank(str_1));
alert(del_blank(str_2));
</script>
标签:
原文地址:http://www.cnblogs.com/kelly007/p/5017431.html