Skip to content

Convert Library

Jeffery Felce edited this page Nov 23, 2019 · 6 revisions

Why write my own conversion library?

I didn't. This library is nothing more than a strongly typed, generic, interface over the System.Convert that avoids boxing and unboxing through the use of reflection and expression trees. It supports Enum, string, bool, char, sbyte, byte, short, ushort, int, unit, long, ulong, float, double, decimal, datetime, object and the nullable forms of those value types out of the box.

Sample Usage

int value = ConvertTo.From("1");

int value ConvertTo.From("1", CultureInfo.InvariantCulture);

Extension

Clone this wiki locally