public class ConvertBaseType { static public bool ConvertTo<T>(string strInt, out T outA) { try { outA = (T)Convert.ChangeType(strInt, typeof(T)); } catch { outA = default(T); return false; } return true; } }
字符类型转换函数
最新推荐文章于 2021-08-19 10:46:14 发布
public class ConvertBaseType { static public bool ConvertTo<T>(string strInt, out T outA) { try { outA = (T)Convert.ChangeType(strInt, typeof(T)); } catch { outA = default(T); return false; } return true; } }