Store array in variable

This commit is contained in:
ivandroly 2015-07-12 19:36:36 +00:00
parent 2635c943e5
commit 0201e621be

View File

@ -131,13 +131,13 @@ namespace Nikse.SubtitleEdit.Controls
string startTime = maskedTextBox1.Text;
startTime = startTime.Replace(' ', '0');
char[] splitChars = { ':', ',', '.' };
if (Mode == TimeMode.HHMMSSMS)
{
if (startTime.EndsWith(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator))
startTime += "000";
string[] times = startTime.Split(new[] { ':', ',', '.' }, StringSplitOptions.RemoveEmptyEntries);
string[] times = startTime.Split(splitChars, StringSplitOptions.RemoveEmptyEntries);
if (times.Length == 4)
{
@ -164,7 +164,7 @@ namespace Nikse.SubtitleEdit.Controls
if (startTime.EndsWith(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator) || startTime.EndsWith(':'))
startTime += "00";
string[] times = startTime.Split(new[] { ':', ',', '.' }, StringSplitOptions.RemoveEmptyEntries);
string[] times = startTime.Split(splitChars, StringSplitOptions.RemoveEmptyEntries);
if (times.Length == 4)
{