如何在 J2ME 中模拟与表示 dd/mm/yyyy 的字符串进行日期比较?
csv字符串数据中有一个Date-like String数据,即Date-like String数据的形式为dd/mm/yyyy
。我想实现一个比较两个类似日期的字符串数据的方法,就像比较两个日期对象一样。在J2ME中如何实现呢?
There is a Date-like String data from a csv String data, that is the Date-like String data has a form of dd/mm/yyyy
. I want to implement a method which compares two Date-like String data like if I compare two Date objects. How to achieve that in J2ME ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过首先比较单个子字符串来比较字符串,如下所示:
即使在 MIDP 中,这也有效,尽管我同意,但这不是赢得任何选美比赛的解决方案。
You can compare the Strings by comparing the individual substrings year-first like there:
This works even in MIDP, although I would agree, it is not the solution winning any beauty-contest.