Microsoft interview question

Write a function that takes in a string and convert it into integer