<分区>
你好,例如我有一个僧伽罗语 unicode 格式的 String
String variable = "සහ"; - Correct String
String variable = "XසහS"; - Incorrect String
我想验证所有字符字符串是否在属于该特定语言的特定 unicode 范围内。
有实现此目标的想法吗?
标签 c#
<分区>
你好,例如我有一个僧伽罗语 unicode 格式的 String
String variable = "සහ"; - Correct String
String variable = "XසහS"; - Incorrect String
我想验证所有字符字符串是否在属于该特定语言的特定 unicode 范围内。
有实现此目标的想法吗?
最佳答案
static bool Validate(string s, char max, char min)
{
for (int i = 0; i < s.Length; i++)
if (s[i] > max || s[i] < min)
return false;
return true;
}
关于c# - 如何检查字符串是否包含特定 unicode 范围内的所有字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17773531/