这是我的数组中的项目列表: 如果您看到生成的文件带有日期(例如,update.20130410.xml
)。我应该只获取最新的文件并删除其余文件。让我们假设数组值是排序的,所以如果我们只是在重复模式中挑选最上面的项目应该没问题。请帮我。
原始数组:
theOneBig.xml
theSecondFine.xml
theTestOne.xml
OtherImp.xml
mrss.xml
update.20130410.xml
update.20130402.xml
update.20120314.xml
update.20120313.xml
update.20120312.xml
update.20120301.xml
update.20130411.xml
file.update.20130410.xml
file.update.20130409.xml
file.update.20130409.xml
我想得到的输出是
theOneBig.xml
theSecondFine.xml
theTestOne.xml
OtherImp.xml
mrss.xml
update.20130410.xml
file.update.20130410.xml