Skip to content

Commit

Permalink
string拓展中添加空判断
Browse files Browse the repository at this point in the history
  • Loading branch information
XFEstudio committed Feb 6, 2024
1 parent 3594e69 commit 312faae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions XFE各类拓展.NetCore/StringExtension/StringExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ public static bool IsIdCard(this string idNumber)
{
return IdCardRegex().IsMatch(idNumber);
}

/// <summary>
/// 判断字符串是否为 null 或者是空字符串
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsNullOrEmpty(this string str) => string.IsNullOrEmpty(str);

/// <summary>
/// 判断字符串是否是 null 、空字符串和仅包含空格的字符串
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsNullOrWhiteSpace(this string str) => string.IsNullOrWhiteSpace(str);

/// <summary>
/// 判断字符串是否为邮箱地址
/// </summary>
Expand Down

0 comments on commit 312faae

Please sign in to comment.