SQLServerCLR之去除字符串中的指定字符串

此文章主要向大家讲述的是SQL Server CLR之去除字符串中的一些指定字符串并取得当中字母的实际操作流程,以下就是文章的主要内容的详细描述,望大家在浏览之后会对其有更好的了解。

 
 
 
 
  1. private static string Cleanse(string InputString)
  2. private static string Cleanse(string InputString) 

过滤掉 And AND aNd 等包含And的字符

 
 
 
 
  1. MatchCollection ms = Regex.Matches(InputString, " (a|A)+(n|N)+(d|D)+ "); 
  2. foreach(Match m in ms) 
  3. InputStringInputString = InputString.Replace(m.Value, ""); 
  4. return InputString; 
  5. private static bool IsLegalCharacter(char c) 

去除不是A-Z的字符以及去除元音 aeoiuy

 
 
 
 
  1. if (Regex.IsMatch(c.ToString().ToLower() 
  2. , "[b-d]|[f-h]|[j-n]|[p-t]|[v-x]|[z]")) 
  3. return true; 
  4. return false; 

上述的相关内容就是对SQL Server CLR的描述,希望会给你带来一些帮助在此方面。

以上的相关内容就是对SQL Server CLR的介绍,望你能有所收获。


分享题目:SQLServerCLR之去除字符串中的指定字符串
链接地址:http://gydahua.com/article/dhgeoco.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流