Thoughtworks interview question

Code to get substring of a string