Given a string, find the character offset for the beginning of each line.
See test.js for an example.
MIT