Minor refactoring - thx Ivandrofly :)

This commit is contained in:
niksedk 2014-07-02 17:53:38 +02:00
parent 199773ec17
commit 5ed0dd3141

View File

@ -66,9 +66,8 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
string text = line.Remove(0, splitter);
p = new Paragraph(DecodeTimeCode(line.Substring(0, splitter)), new TimeCode(0,0,0,0), text);
subtitle.Paragraphs.Add(p);
text = text.Trim().Trim('').Trim('.').Trim(';').Trim(':').Trim();
if (text.StartsWith("0") || text.StartsWith("1") || text.StartsWith("2") || text.StartsWith("3") || text.StartsWith("4") ||
text.StartsWith("5") || text.StartsWith("6") || text.StartsWith("7") || text.StartsWith("8") || text.StartsWith("9"))
text = text.Trim().Trim('', '.', ';', ':').Trim();
if (text.Length > 0 && "0123456789".Contains(text[0].ToString()))
_errorCount++;
}
else