Skip to content

Commit

Permalink
misc: ....
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Sep 21, 2024
1 parent a468b70 commit ce6b1b9
Showing 1 changed file with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,30 @@ public static int ToMilliseconds(this string src)
int result;
string[] spilt = src.Split(".");

if (spilt.Length < 3)
string formatString = "";

for (int i = 0; i < spilt.Length; i++)
{
// ???
Logging.Log($"给定的时间不正确:{src}");
return int.MaxValue;
}
int length = spilt[i].Length;

switch (i)
{
case 0:
formatString += new string('m', length);
break;

string formatString = "".PadRight(spilt[0].Length, 'm')
+ @"\."
+ "".PadRight(spilt[1].Length, 's')
+ @"\."
+ "".PadRight(spilt[2].Length, 'f');
case 1:
formatString += new string('s', length);
break;

case 2:
formatString += new string('f', length);
break;
}

if (i < spilt.Length - 1)
formatString += @"\.";
}

try
{
Expand Down

0 comments on commit ce6b1b9

Please sign in to comment.