展开全部
private void TxtEquipmentManufactureDate_Change()
{
string a1, b1,b2,b3;
a1 = TxtEquipmentManufactureDate.Text.TrimStart();
if (a1.Length.Equals(8) && a1.IndexOf("-").CompareTo(0) > 0)
{
b1 = a1.Substring(0, 4);
b2 = a1.Substring(5, 2);
b3 = a1.Substring(a1.Length - 2, 2);
a1 = string.Concat(b1, "-", b2, "-", b3);
}
TxtEquipmentManufactureDate.Text = a1;
}
{
string a1, b1,b2,b3;
a1 = TxtEquipmentManufactureDate.Text.TrimStart();
if (a1.Length.Equals(8) && a1.IndexOf("-").CompareTo(0) > 0)
{
b1 = a1.Substring(0, 4);
b2 = a1.Substring(5, 2);
b3 = a1.Substring(a1.Length - 2, 2);
a1 = string.Concat(b1, "-", b2, "-", b3);
}
TxtEquipmentManufactureDate.Text = a1;
}
更多追问追答
追问
大哥辛苦了
只是没看懂
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询