Hello, all!

I recently had an issue with consistency in the behavior of Integer.parse/2 
where it handles trailing whitespace, but fails to handle leading 
whitespace. 

Example:
Integer.parse("12 ")
{12, " "}
Integer.parse(" 12")
:error

Because the trailing whitespace was handled, I had operated under the false 
assumption that the function would properly trim whitespace (both trailing 
*and* leading) and return a valid integer. For this reason, it look me a 
bit to track down leading whitespace as the root-cause of a production 
issue. 

I'd like to propose trimming whitespace as an enhancement to the 
functionality of Integer.parse/2 to improve consistency in its behavior. 

~ Izzy

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/c76ea4b9-68cd-4402-9747-c61e503f11f2n%40googlegroups.com.

Reply via email to