Just like the title says, I\'ve been able to isolate from a text file a string containing a duration in the format of \"HH:mm:ss.\" How would I go about converting it to a d
I would use String.split() to accomplish this. That will split it into an array based on the regex/separators that you specify in the parameters. Something like this,
String time = "08:30:00";
String[] splitValues = time.split(":");
double hour = splitValue[0];
double minute = splitValue[1];
double seconds = splitValue[2];
You could then add up the values. You know that there are 60 minutes in an hour, and 60 seconds in a minute. You could convert these to hours by dividing by 60 and 3600, respectively. Then, it's just a simple matter of addition.