chapter 10 exercise 10-6: split into str_list