how to split a string into chunks nodejs

Solutions on MaxInterview for how to split a string into chunks nodejs by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "how to split a string into chunks nodejs"
Celia
15 Apr 2019
1function chunkString(str, length) {
2  return str.match(new RegExp('.{1,' + length + '}', 'g'));
3}
4