Pregunta de entrevista de Microsoft

Write a method to parse an integer from a string.