List files starting with a specific name using java
- by user3610075
i want to list files starting with a name like "Report" from a folder.
i found this in google to list all files but i don't how to list file starting with a name.
Thank you
File directory = new File("C:\\Users\\kiki\\Downloads");
File[] files = directory.listFiles();
for (int index = 0; index < files.length; index++)
{
//Print out the name of files in the directory
System.out.println(files[index].toString());
}