SHARE
TWEET

Untitled

a guest Apr 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private wordwrap(m, b, c) {
  2.             var i, j, l, s, r;
  3.             if (m < 1)
  4.                 return m;
  5.             for (i = -1, l = (r = m.split("\n")).length; ++i < l; r[i] += s)
  6.                 for (s = r[i], r[i] = ""; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : ""))
  7.                     j = c == 2 || (j = s.slice(0, m + 1).match(/\S*(\s)?$/))[1] ? m : j.input.length - j[0].length
  8.                         || c == 1 && m || j.input.length + (j = s.slice(m).match(/^\S*/)).input.length;
  9.             return r.join("\n");
  10.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top