Delete Files with same Prefix String using Java

前端 未结 11 1724
梦谈多话
梦谈多话 2020-12-16 09:11

I have around 500 text files inside a directory with a same prefix in their filename say dailyReport_.

The latter part of the file is the date of the fi

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 09:55

    or in scala

    new java.io.File(<>).listFiles.filter(_.getName.endsWith(".txt")).foreach(_.delete())
    

提交回复
热议问题