StringParserExtensions

Developer
Mar 7, 2009 at 9:47 AM
Hi,

About the:

ToInt
ToBoolean
ToDouble
ToFloat

extension.

I saw using reflector that the string class implements IConvertable so code like:

      string Test = "1234";
      Convert.ToInt32(Test);

Is how the framework support a lot of conversions.

string.ToInt32 is implemented as:

int IConvertible.ToInt32(IFormatProvider provider)
{
    return Convert.ToInt32(this, provider);
}

Should'nt the convert class be used?

Regards, Jacco