Пример #1
0
 /// <summary>
 /// To judge whether the string contains number or not.
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static bool ContainsNumber(string str) =>
 !string.IsNullOrWhiteSpace(str) && RegexJudgment.IsMatch(str, "[0-9]+");
Пример #2
0
 /// <summary>
 /// To judge whether the string contains chinese characters or not.
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static bool ContainsChineseCharacters(string str) =>
 !string.IsNullOrWhiteSpace(str) && RegexJudgment.IsMatch(str, "[\u4e00-\u9fa5]+");