Microsoft interview question

Write a method to parse an integer from a string.