2026-04-27 11:20:13 +08:00
|
|
|
namespace RedHotRoast
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
public static class StringExtend
|
|
|
|
|
{
|
|
|
|
|
public static double ToDouble(this string str)
|
|
|
|
|
{
|
|
|
|
|
double temp = 0d;
|
|
|
|
|
double.TryParse(str, out temp);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static float ToFloat(this string str)
|
|
|
|
|
{
|
|
|
|
|
float temp = 0;
|
|
|
|
|
float.TryParse(str, out temp);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool IsNullOrWhiteSpace(this string str)
|
|
|
|
|
{
|
|
|
|
|
return string.IsNullOrWhiteSpace(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|