I have some strings of xxh:yym format where xx is hours and yy is minutes like \"05h:30m\". What is an elegant way to convert a string of this type to TimeSpan?
DateTime.ParseExact or DateTime.TryParseExact lets you specify the exact format of the input. After you get the DateTime, you can grab the DateTime.TimeOfDay which is a TimeSpan.
In the absence of TimeSpan.TryParseExact, I think an 'elegant' solution is out of the mix.
@buyutec As you suspected, this method would not work if the time spans have more than 24 hours.