js 去掉字符串前面的0

<script>
var a='00123';
alert(a.replace(/\b(0+)/gi,""));
</script>
posted @ 2021-03-04 10:40  星空飘渺  阅读(5648)  评论(0编辑  收藏  举报