An unexpected string to int exception.

Taylor Hillegeist via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 17 08:13:47 PST 2016


On Wednesday, 17 February 2016 at 16:11:44 UTC, Taylor Hillegeist 
wrote:
> I think the following error message says it all.
>
> std.conv.ConvException at C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2002): Unexpected '1' when converting from type string to type int
>
> I would expect that 1 would be among the group of expected 
> items.

Also how rude of me:

DMD32 D Compiler v2.070.0

code segment in question
+++++
		if(l.style.canFind("Heading")){
			string tmp = l.style[6..$];
			ON.incrementNum( to!int(tmp));
+++++


More information about the Digitalmars-d-learn mailing list