This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Converting the string value to T type | |
/// </summary> | |
/// <typeparam name="T">Type to convert string value to</typeparam> | |
/// <param name="value">String value to be converted to type T</param> | |
/// <returns>Returns converted string value to type T</returns> | |
public static T ConvertTo<T>(this string value) where T : IConvertible | |
{ | |
var typeCode = default(T).GetTypeCode(); | |
switch (typeCode) |
NewerOlder