chapter 12 exercise 12-8: add the getline function to the Str class