Convert string to integer