init commit
This commit is contained in:
21
20220330_Vote/RoadFlow.Pinyin/PinyinUtil.cs
Normal file
21
20220330_Vote/RoadFlow.Pinyin/PinyinUtil.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RoadFlow.Pinyin
|
||||
{
|
||||
/// <summary>
|
||||
/// 拼音工具类
|
||||
/// </summary>
|
||||
public static class PinyinUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// 判断字符是否是汉字
|
||||
/// </summary>
|
||||
/// <param name="ch">要判断的字符</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsHanzi(char ch)
|
||||
{
|
||||
return Regex.IsMatch(ch.ToString(), @"[\u4e00-\u9fbb]");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user