/// 根据正则表达式替换指定字符串为空格()
/// </summary>
/// <param name="pattern"></param>
/// <param name="strSource"></param>
/// <returns></returns>
public static string RexplaceString(string pattern, string strSource)
{
strSource = Regex.Replace(strSource, pattern,new MatchEvaluator(CapText));
return strSource;
}
/// 逻辑处理,返回你要替换的目标字符串
/// </summary>
/// <param name="m"></param>
/// <returns></returns>
{
string x = m.ToString();
// If the first char is lower case...
if (char.IsLower(x[0]))
{
// Capitalize it.
return char.ToUpper(x[0]) + x.Substring(1, x.Length-1);
}
return x;
}