亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

C# 刪除字符串中的中文(實(shí)例分享)

 更新時(shí)間:2016年12月25日 14:06:17   作者:欣宇  
本文主要分享了C#刪除字符串中的中文的具體實(shí)例,具有一定的參考價(jià)值,需要的朋友一起來(lái)看下吧

話不多說(shuō),請(qǐng)看代碼

/// <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 = 0; index < strsStrings.Length; index++)
    {
      if (strsStrings[index] >= 0x4e00 && strsStrings[index] <= 0x9fa5)
      {
        continue;
      }
      retValue += strsStrings[index];
    }
  }
  return retValue;
}

以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

最新評(píng)論