mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Improved RemoveSubStationAlphaFormatting
This commit is contained in:
parent
eee06fe2e4
commit
af0b8932ca
@ -427,11 +427,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private static string RemoveSubStationAlphaFormatting(string s)
|
||||
{
|
||||
int indexOfBegin = s.IndexOf('{');
|
||||
while (indexOfBegin >= 0 && s.IndexOf('}') > indexOfBegin)
|
||||
while (indexOfBegin >= 0)
|
||||
{
|
||||
int indexOfEnd = s.IndexOf('}');
|
||||
s = s.Remove(indexOfBegin, (indexOfEnd - indexOfBegin) + 1);
|
||||
indexOfBegin = s.IndexOf('{');
|
||||
int indexOfEnd = s.IndexOf('}', indexOfBegin + 1);
|
||||
if (indexOfEnd < indexOfBegin)
|
||||
break;
|
||||
s = s.Remove(indexOfBegin, indexOfEnd - indexOfBegin + 1);
|
||||
indexOfBegin = s.IndexOf('{', indexOfBegin);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user