I'm trying to get the time from input of html txt_URL but the array returns nothing.
Not sure where I went wrong. Any help is appreciated. Thanks!

input:
Deleting 11 files.
Details: Time Deleted = 01:16:30, Time Left = 00:00:00,

output:
01:16:30

            string before = txt_URL.Value;
             string after = Regex.Replace(before, @"[ =.]",",");

             string[] strValues1 = after.Split(',');
             Text2.Value = strValues1[7];

Recommended Answers

All 3 Replies

If you just want the time, why not use a regex match on \d{2}:\d{2}:\d{2}

This is what you are getting:

Before = "Details: Time Deleted = 01:16:30, Time Left = 00:00:00,"
After = "Details:,Time,Deleted,,,01:16:30,,Time,Left,,,00:00:00,"

strValues1[0] = "Details:"
strValues1[1] = "Time"
strValues1[2] = "Deleted"
strValues1[3] = ""
strValues1[4] = ""
strValues1[5] = "01:16:30"
strValues1[6] = ""
strValues1[7] = "Time"
strValues1[8] = "Left"
strValues1[9] = ""
strValues1[10] = ""
strValues1[11] = "00:00:00"
strValues1[12] = ""

Thanks!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.