Search file in Directory using partial name in C#
I need to search file in directory using partial name.Ex:
Directory : c:\Path
Filename : Error_15623-89562-84562_response.xml
Partial file name: 15623-89562-84562
I have tried below.
Directory.GetFiles("c:\Path", "*15623-89562-84562*.xml", SearchOption.AllDirectories).
But it didn't work
Sample file names are :
Error_15623-89562-84562-12563.xml
15623-89562-84562_Response.xml
Duplicate_15623-89562-84562_Response.xml
Note: Directory contains thousands of files.