Tuesday, March 09, 2010

“bool” is just too restrictive

protected bool ParamValueIsTrueAsBoolean(string stringvalue)
{
return (stringvalue.Equals("J") ||
stringvalue.Equals("Y") ||
stringvalue.Equals("1") ||
stringvalue.Equals("j") ||
stringvalue.Equals("y") ||
stringvalue.Equals("True") ||
stringvalue.Equals("true"));
}

2 comments:

  1. That's terrible!

    We live in Canada. Where are "vrai", "o", and "O"?

    Seriously, I'm a little surprised that "t" and "T" aren't there...

    ReplyDelete
  2. I'm sure I'm not allowed to tell you that I believe the data source is Flemish.

    ReplyDelete