Programming exercise for string parsing