Use trim() before trying to convert input string into a Long

This strips the leading whitespace.