📌  相关文章
📜  将字符串拆分为相等的块 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:46.435000             🧑  作者: Mango

代码示例1
var str="hello how are you"
var size=3
console.log(str.match(new RegExp('.{1,' + size + '}', 'g')))
//returns ["hel","lo ","how"," ar","e y","ou"]