java - How to check if directory contains file which name contains certain string? -


I want to get the ard12333.txt file, but the number is part variable, so I should check that the string in the file is "addicted" and Then extrapolate the number part How to do this

Steps for your work:

1) Get the file name from.

2) Check if there is ard in it or not.

3) If so, change the rest of the filename without extensions, either integer or long, or whatever number, if not, go to step 1 to check the next file.

4) If the value of variable and converting numbers matches you, you're doing. Break the loop and do whatever you want.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -