/// <summary>
/// 去掉字符串中的数字
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string RemoveNumber(string key)
{
    return System.Text.RegularExpressions.Regex.Replace(key, @"\d", "");
}

 

 

 

/// <summary>
/// 去掉字符串中的非数字
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string RemoveNotNumber(string key)
{
    return System.Text.RegularExpressions.Regex.Replace(key, @"[^\d]*", "");
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-14
  • 2021-07-29
  • 2022-12-23
相关资源
相似解决方案