33 lines
892 B
C#
33 lines
892 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace DeviceRepairAndOptimization.Utils
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
}
|