Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何检查日期是否采用特定格式,例如“dd/MM/yyyy”,那么它会做一些事情,但如果它不是这种格式,或者是否有像“NA”这样的字符串,或者它应该有什么抛出错误。
您可以尝试使用 解析日期SimpleDateFormat。如果有效,则日期为预期格式。
SimpleDateFormat