You can also use foreach_line/2 and mapeach_line/2; these elid blank
lines, and have the same line semantics as the first string:tokens/2
solution, but you can easily adapt these. These also return the
remainder of the string and the {remainder(),mapped_results()},
respectively.