0

I have the following codes and I'm not sure if there's a better or easier way of doing it?

Any help appreciated. Thanks!

MatchCollection matches1 = Regex.Matches(txt_description.Value, @"\d{2}:\d{2}:\d{2}");

            Match firstMatch1 = matches1[0];
            Match firstMatch2 = matches1[1];
            Match firstMatch3 = matches1[2];
            Match firstMatch4 = matches1[3];

            td1.InnerHtml = firstMatch1.Value;
            td2.InnerHtml = firstMatch2.Value;
            td3.InnerHtml = firstMatch3.Value;
            td4.InnerHtml = firstMatch4.Value;
1
Contributor
1
Reply
9
Views
4 Years
Discussion Span
Last Post by Jahliah
0

Updated version

MatchCollection matches1 = Regex.Matches(txt_desription.Value, @"\d{2}:\d{2}:\d{2}");
                td1.InnerHtml = matches1[0].Value;
                td2.InnerHtml = matches1[1].Value;
                td3.InnerHtml = matches1[2].Value;
                td4.InnerHtml = matches1[3].Value;
                td5.InnerHtml = matches1[4].Value;
                td6.InnerHtml = matches1[5].Value;
                td7.InnerHtml = matches1[6].Value;
                td8.InnerHtml = matches1[7].Value;
                td9.InnerHtml = matches1[8].Value;
                td10.InnerHtml = matches1[9].Value;
                td11.InnerHtml = matches1[10].Value;
                td12.InnerHtml = matches1[11].Value;
                td13.InnerHtml = matches1[12].Value;
                td14.InnerHtml = matches1[13].Value;
                td15.InnerHtml = matches1[14].Value;
                td16.InnerHtml = matches1[15].Value;
                td17.InnerHtml = matches1[16].Value;
                td18.InnerHtml = matches1[17].Value;
                td19.InnerHtml = matches1[18].Value;
                td20.InnerHtml = matches1[19].Value;
                td21.InnerHtml = matches1[20].Value;
                td22.InnerHtml = matches1[21].Value;
                td23.InnerHtml = matches1[22].Value;
                td24.InnerHtml = matches1[23].Value;
                td25.InnerHtml = matches1[24].Value;
                td26.InnerHtml = matches1[25].Value;
                td27.InnerHtml = matches1[26].Value;
                td28.InnerHtml = matches1[27].Value;
                td29.InnerHtml = matches1[28].Value;
                td30.InnerHtml = matches1[29].Value;
                td31.InnerHtml = matches1[30].Value;
                td32.InnerHtml = matches1[31].Value;
                td33.InnerHtml = matches1[32].Value;
                td34.InnerHtml = matches1[33].Value;
                td35.InnerHtml = matches1[34].Value;
                td36.InnerHtml = matches1[35].Value;
                td37.InnerHtml = matches1[36].Value;
                td38.InnerHtml = matches1[37].Value;
                td39.InnerHtml = matches1[38].Value;
                td40.InnerHtml = matches1[39].Value;
                td41.InnerHtml = matches1[40].Value;
                td42.InnerHtml = matches1[41].Value;
                td43.InnerHtml = matches1[42].Value;
                td44.InnerHtml = matches1[43].Value;
                td45.InnerHtml = matches1[44].Value;
                td46.InnerHtml = matches1[45].Value;
                td47.InnerHtml = matches1[46].Value;
                td48.InnerHtml = matches1[47].Value;
                td49.InnerHtml = matches1[48].Value;
                td50.InnerHtml = matches1[49].Value;
                td51.InnerHtml = matches1[50].Value;
                td52.InnerHtml = matches1[51].Value;
                td53.InnerHtml = matches1[52].Value;
                td54.InnerHtml = matches1[53].Value;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.