Class ConvertTypeNameTypeNumbers
- Namespace
- SunamoConverters.Converts
- Assembly
- SunamoConverters.dll
Converts numeric type names to System.Type objects.
public class ConvertTypeNameTypeNumbers
- Inheritance
-
ConvertTypeNameTypeNumbers
- Inherited Members
- Extension Methods
Methods
ToType(string)
Converts a numeric type name string to a System.Type. Returns null if the type is not a supported numeric type. When comparing the obtained type, use typeof(int, string, byte) not typeof(Int32, String, Byte). The input string must be without "System." prefix.
public static Type? ToType(string typeName)
Parameters
typeNamestringThe type name to convert (e.g., "int", "Int32", "float", "Single").
Returns
- Type
The corresponding System.Type, or null if the type is not a supported numeric type.