JavaScript 删除字符串前的 0

var str=str.replace(/0(\d)/g,"$1"); str=str.replace(/0(\d)/g,"$1"); window.alert(str);