Refactor (minor)

This commit is contained in:
niksedk 2019-08-14 17:02:26 +02:00
parent 92a427c4d5
commit 19ff3b46dd
3 changed files with 7 additions and 3 deletions

View File

@ -98,7 +98,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
private TimeCode DecodeTime(string s)
{
return DecodeTimeCodeFramesFourParts(s.Split(new char[] { ':' }));
return DecodeTimeCodeFramesFourParts(s.Split(':'));
}
}
}

View File

@ -161,6 +161,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
sb.Append(Encoding.UTF8.GetString(buffer, textBegin, textIndex - textBegin - 1));
}
p.Text = sb.ToString().Trim();
if (p.Text.Length > 1 && p.Text[0] == 31 || p.Text[1] == 65279)
{
p.Text = p.Text.Remove(0, 2);
}
for (int k = 0; k < p.Text.Length; k++)
{
if (p.Text[k] == 65533)

View File

@ -263,10 +263,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
break;
}
}
var parts = localSb.ToString().Split(new char[] { ':', '.' });
var parts = localSb.ToString().Split(new [] { ':', '.' });
if (parts != null && parts.Length == 3)
{
parts = ("00:" + localSb.ToString()).Split(new char[] { ':', '.' });
parts = ("00:" + localSb).Split(new [] { ':', '.' });
}
if (parts != null && parts.Length == 4)
{