Like I am having Req_250: a Req_6497: b Sysreq_234 a Here I want to put-> "COLON" instead of ":" and "_" instead of " " How to that please give idea
You can used File renameTo()
to rename your file
such as
File file=new File("../path/Req_250: a Req_6497: b Sysreq_234.docx");
boolean renameResult = file.renameTo(new File(file.getParent()+"/"+file.getName().replace(":", "COLON").replace(" ", "_")));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.