Java searching file name from the one folder

前端 未结 3 1848
天命终不由人
天命终不由人 2021-01-26 02:04

I am studying Java and I am not really sure the way to searching file. I would like to build the function which returning file names ( the files name should begin with st

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-26 02:18

    File#getName() should return aString`, then use:

    filename.startsWith(...);
    filename.endsWith(...);
    

提交回复
热议问题