Google interview question

Write a substring text parser.