Let’s say I have a string like '2:19.83 blah blah...blah blah' where the format is minutes:seconds.centiseconds blah... and blah can represent any sequence of characters other than a newline.
I want to parse and get the number of seconds rounded down. So in the above example, the result would be 139.
What is the best way to do this?
I would first get the time portion from the string
Then I would read it using strptime…
and then finally, get the time in seconds.
Not a 1-liner, but pretty simple…