如何将时间跨度字符串解析为小时,分钟? [英] How can I parse timespan string to hour, minutes?
本文介绍了如何将时间跨度字符串解析为小时,分钟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个字符串"P18DT5H2M3S",表示:18天5小时2分钟3秒.
I have a string "P18DT5H2M3S" which means: 18 days, 5 hours, 2 minutes, 3 seconds.
我必须将此字符串解析为小时和分钟.我应该使用正则表达式还是split或substr等...
I have to parse this string to hour and minute. Should I use regex or split or substr etc...?
查看全文