Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (() => {
  2. let str = 'v13.9.0, v12.16.1, v11.15.0, v10.19.0, v9.11.2, v8.17.0, v7.10.1, v6.17.1, v5.12.0, v4.9.1';
  3.  
  4. const lines = [];
  5.  
  6. while (str.length > 0){
  7.     let x = str.match(/.{1,20}(?<=,)/);
  8.     lines.push(x);
  9.     if (!x) break;
  10.     [ x ] = x;        
  11.     str = str.substring(x.length, str.length);
  12. }
  13.  
  14. console.log(lines.join('\n'));
  15.  
  16. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement