Implement string to integer conversion