Converts a string to an integer, stopping at the first invalid character.
int atoi(String str) { return strtol(str); }