chapter 6: implement split function by using find_if generic algorithm from standard library