17 using System.Globalization;
32 return System.TimeSpan.Parse(value, CultureInfo.InvariantCulture);
40 return System.TimeSpan.TryParse(input, CultureInfo.InvariantCulture, out value);
55 return System.TimeSpan.TryParseExact(input, format, CultureInfo.InvariantCulture, timeSpanStyle, out value);
64 return System.DateTime.Parse(value, CultureInfo.InvariantCulture);
73 return System.DateTime.ParseExact(value, format, CultureInfo.InvariantCulture);
80 public static DateTime
DateTimeExact(
string value,
string format, DateTimeStyles dateTimeStyles)
82 return System.DateTime.ParseExact(value, format, CultureInfo.InvariantCulture, dateTimeStyles);
89 public static bool TryParse(
string input, DateTimeStyles dateTimeStyle, out System.DateTime value)
91 return System.DateTime.TryParse(input, CultureInfo.InvariantCulture, dateTimeStyle, out value);
99 public static bool TryParseExact(
string input,
string format, DateTimeStyles dateTimeStyle, out System.DateTime value)
101 return System.DateTime.TryParseExact(input, format, CultureInfo.InvariantCulture, dateTimeStyle, out value);
107 public static double Double(
string value)
109 return double.Parse(value, CultureInfo.InvariantCulture);
116 public static bool TryParse(
string input, NumberStyles numberStyle, out
double value)
118 return double.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);
126 return decimal.Parse(value, CultureInfo.InvariantCulture);
133 public static decimal
Decimal(
string value, NumberStyles numberStyles)
135 return decimal.Parse(value, numberStyles, CultureInfo.InvariantCulture);
142 public static bool TryParse(
string input, NumberStyles numberStyle, out decimal value)
144 return decimal.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);
150 public static int Int(
string value)
152 return int.Parse(value, CultureInfo.InvariantCulture);
159 public static bool TryParse(
string input, NumberStyles numberStyle, out
int value)
161 return int.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);
167 public static long Long(
string value)
169 return long.Parse(value, CultureInfo.InvariantCulture);
176 public static long Long(
string value, NumberStyles numberStyles)
178 return long.Parse(value, numberStyles, CultureInfo.InvariantCulture);
185 public static bool TryParse(
string input, NumberStyles numberStyle, out
long value)
187 return long.TryParse(input, numberStyle, CultureInfo.InvariantCulture, out value);
193 public static T
Enum<T>(
string input,
bool ignoreCase =
true)
194 where T : struct, IConvertible
197 if (!
TryParse(input, out value, ignoreCase))
208 public static bool TryParse<T>(
string input, out T value,
bool ignoreCase =
true)
209 where T : struct, IConvertible
211 return System.Enum.TryParse<T>(input, ignoreCase, out value);