62,072
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Test
{
static void Main()
{
string str = @"asdadasd <br>p <br>p <br>p <br>p ";
Console.WriteLine(Regex.Replace(str,@"<br>p",""));
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Test
{
static void Main()
{
string str = @"ccccc <br>p <br>pccc <br>p <br>p", str1 = str;
while ((str1 = Regex.Replace(str, @"\s*<br>p\s*$", "")).Length != str.Length)
str = str1;
Console.WriteLine(str1);
}
}
}