Skip to content

Instantly share code, notes, and snippets.

@fatihacet
Created November 2, 2012 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatihacet/4000605 to your computer and use it in GitHub Desktop.
Save fatihacet/4000605 to your computer and use it in GitHub Desktop.
Divide string into parts
var arr = "123456789012341".match(/.{3,4}/g);
console.log(arr); // ["1234", "5678", "9012", "341"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment