Cleaning a pasted class list
- Input
- Text = ' Alice ' on one line, a blank line, then Bob, then ' Carol '
- Working
- Splitting on line breaks gives four raw fragments. Trimming turns ' Alice ' into Alice and ' Carol ' into Carol, and the blank line is dropped rather than becoming an empty entrant that could 'win'.
- Result
- A clean list of 3 names: Alice, Bob, Carol