Function parseWords

    • Split s into words and separators. Returns:

      words[i] — the i-th run of word characters seps[0] — leading non-word characters (possibly empty) seps[i] — for 1 ≤ i ≤ words.length-1, the separator BETWEEN words[i-1] and words[i] seps[words.length] — trailing non-word characters

      Always satisfies seps.length === words.length + 1.

      Parameters

      • s: string

      Returns { seps: string[]; words: string[] }