Check if a string represents an integer