I'd implement this much simpler.

```D
auto result = s.startsWith!((a, b) => std.ascii.toLower(a) == b)("true", "false");
if (result == 0)
{
    throw parseError("..."); 
}
return result == 1;
```