3 个解决方案
#1
[
三个空字符串自行查看方法注释,
new Regex("").Replace("", "", 1)
三个空字符串自行查看方法注释,
,
string result = Regex.Replace(input, @"([a-zA-Z]+)(\d+)", "$2");
static void Main(string[] args)]
{
Console.WriteLine(new Regex("aaa").Replace("aaa0009978796aaa", "", 1));
Console.WriteLine(Regex.Replace("aaa0009978796aaa", "^aaa", ""));
Console.WriteLine(Regex.Replace("aaa0009978796aaa", "aaa(?!$)", ""));
}
#1
[
三个空字符串自行查看方法注释,
new Regex("").Replace("", "", 1)
三个空字符串自行查看方法注释,
,
string result = Regex.Replace(input, @"([a-zA-Z]+)(\d+)", "$2");
static void Main(string[] args)]
{
Console.WriteLine(new Regex("aaa").Replace("aaa0009978796aaa", "", 1));
Console.WriteLine(Regex.Replace("aaa0009978796aaa", "^aaa", ""));
Console.WriteLine(Regex.Replace("aaa0009978796aaa", "aaa(?!$)", ""));
}