digitalmars.D.learn - Parse issue
- Andrej Mitrovic (10/10) Mar 11 2012 Does anyone else think this should be fixed?
- bearophile (4/5) Mar 11 2012 I agree.
- Andrej Mitrovic (1/1) Mar 11 2012 Thanks for the input. http://d.puremagic.com/issues/show_bug.cgi?id=7692
Does anyone else think this should be fixed?
import std.conv;
void main()
{
string s1 = "ff";
string s2 = "0xff";
assert(parse!uint(s1, 16) == 0xff); // ok
assert(parse!uint(s2, 16) == 0xff); // fail, it's 0
}
I think parse should pop the first two characters if the string starts with 0x.
Mar 11 2012
Andrej Mitrovic:I think parse should pop the first two characters if the string starts with 0x.I agree. Bye, bearophile
Mar 11 2012
Thanks for the input. http://d.puremagic.com/issues/show_bug.cgi?id=7692
Mar 11 2012








Andrej Mitrovic <andrej.mitrovich gmail.com>