有没有关于如何优化的建议,并在以下情况下缩短:
if (secound < 10)
TimerLabel.Text = $"{Hour}:{Minute}:0{secound}";
if (Minute< 10)
TimerLabel.Text = $"{Hour}:0{Minute}:{secound}";
if (Hour < 10)
TimerLabel.Text = $"0{Hour}:{Minute}:{secound}";
if(secound <10 && Minute < 10)
TimerLabel.Text = $"{Hour}:0{Minute}:0{secound}";
if (secound < 10 && Hour < 10)
TimerLabel.Text = $"0{Hour}:{Minute}:0{secound}";
if(Minute < 10 && Hour < 10)
TimerLabel.Text = $"0{Hour}:0{Minute}:{secound}";
if(Hour < 10 && Minute < 10 && secound < 10)
TimerLabel.Text = $"0{Hour}:0{Minute}:0{secound}";
Run Code Online (Sandbox Code Playgroud)