DeviceManager/DeviceRepairAndOptimization/Common/StringExtended.cs
2024-05-28 22:36:38 +08:00

31 lines
854 B
C#

namespace DeviceRepairAndOptimization.Common
{
public static class StringExtended
{
/// <summary>
/// 判断字符串是否为空
/// </summary>
/// <param name="Value"></param>
/// <returns></returns>
public static bool IsNullOrWhiteSpace(this string Value)
{
if (!string.IsNullOrWhiteSpace(Value))
return false;
return true;
}
/// <summary>
/// 判断字符串是否为整数型
/// </summary>
/// <param name="Value"></param>
/// <returns></returns>
public static bool IsInt(this string Value)
{
int intValue = 0;
if (!string.IsNullOrWhiteSpace(Value))
return false;
return int.TryParse(Value, out intValue);
}
}
}