我有文字
1
00:00:03,837 --> 00:00:07,170
Text1
2
00:00:08,875 --> 00:00:10,968
Tex2
3
00:00:11,010 --> 00:00:13,843
Text3
我想让它像那样
00:00:03,837 --> 00:00:07,170
Text1
00:00:08,875 --> 00:00:10,968
Tex2
00:00:11,010 --> 00:00:13,843
Text3
我试过这个:
Match match = Regex.Match(loadedText, @"\d{1,4}\r\n");
if (match.Success)
{
for (int i = 0; i < match.Groups.Count; i++)
{
loadedText= loadedText.Replace(match.Groups[i].Value, "");
}
rtbLoaded.Text = loadedText;
}
但它给了我这个结果:
00:00:03,837 --> 00:00:07,170
Text1
2
00:00:08,875 --> 00:00:10,968
Tex2
3
00:00:11,010 --> 00:00:13,843
Text3
所以只有一次......我做错了什么?