<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
var s='我123。4567890',reg=/.{4}/g,rs=s.match(reg),h=[];
$.each(rs,function(i,v){
h.push('<span>'+v+'</span>');
})
console.log(h.join(''))
</script>
</body>
</html>
js每4个字符分割
最新推荐文章于 2024-06-19 11:06:40 发布