I have in project one folder for uploaded files, I want to check if in this folder exist files contains some text in title. I want to rename the file if it contains text "test"
For example, in folder "/uploadedFiles/" I have 4 files: test_01.jpg, 02.jpg, 03.png, test_04.txt
I want to rename the files: "test_01.jpg
" to "01.jpg
" and "test_04.txt
" to "04.txt
"
I can edit the files like this:
System.IO.File.Move("test_01.jpg", "test_01.jpg".Replace("test_",""));
I need to get list of files that contains "test" in title from this folder