/// <summary>
/// 删除字符串中的中文
/// </summary>
public static string Delete中文(string str)
{
string retValue = str;
if (System.Text.RegularExpressions.Regex.IsMatch(str, @"[\u4e00-\u9fa5]"))
{
retValue = string.Empty;
var strsStrings = str.ToCharArray();
for (int index = ; index < strsStrings.Length; index++)
{
if (strsStrings[index] >= 0x4e00 && strsStrings[index] <= 0x9fa5)
{
continue;
}
retValue += strsStrings[index];
}
}
return retValue;
}
相关文章
- 【SQLSERVER】如何找出字符串中的数字
- 常用类库之.NET中的字符串
- C#中dynamic的正确用法 以及 typeof(DynamicSample).GetMethod("Add");
- JAVA对数据库进行操作,实现数据库中数据的插入,查询,更改,删除操作
- 删除软件的安装文件时提示“操作无法完成,因为文件已在system中打开”,怎么办?
- [LC]237题 Delete Node in a Linked List (删除链表中的节点)(链表)
- .NET(C#):觉察XML反序列化中的未知节点
- Python:字符串中的大小写转换
- 将字符串中的字母全部转换为大写字母/小写字母
- 字符和字符串(13)——C#中把英文字母转换为大写或小写的方法