/// <summary> /// To judge whether the string contains number or not /// </summary> /// <param name="str"></param> /// <returns></returns> public static bool ContainsNumber(string str) { return(!string.IsNullOrWhiteSpace(str) && RegexJudgement.IsMatch(str, "[0-9]+")); }
/// <summary> /// To judge whether the string contains chinese characters or not /// </summary> /// <param name="str"></param> /// <returns></returns> public static bool ContainsChineseCharacters(string str) { return(!string.IsNullOrWhiteSpace(str) && RegexJudgement.IsMatch(str, "[\u4e00-\u9fa5]+")); }