javascript用正则表达式把1234567890替换为abcdefghij
(编辑:jimmy 日期: 2024/11/15 浏览:3 次 )
复制代码 代码如下:
<script>
alert('0123456789'.replace(/(\d)/g, function ($1){return "abcdefghij".split("")[$1];}));
</script>
<script>
alert('0123456789'.replace(/(\d)/g, function ($1){return "abcdefghij".split("")[$1];}));
</script>
下一篇:无殇 javascript正则练习器