Using Directory.GetFiles Filtering multiple types of files

Time:2020-9-30

The author of the original text does not allow reprint, send a chain here, everybody goes to see.

https://codedefault.com/s/how-do-i-call-directory-getfiles-with-multiple-filters-in-csharp-application/

 

For backup. Here’s a brief idea Directory.GetFiles.Where Use lambda expressions to filter.

To be more specific, one is used in where. Endwith, and the other is used in where Regex.IsMatch Regular expression for.

For example, to filter out. JPG /. PNG /. TIFF /. BMP /. GIF files, the regular expression is:

"^.+\.(jpg|png|bmp|gif|tiff)$"

  

Recommended Today

Webassembly and trust

Rust’s support for webassembly is the most perfect. After all, a large part of Mozilla’s original development of trust was to write servo (browser rendering engine). In addition, the two wasm runtimes, wasmer and wasmtime, which we introduced, are also written with rust. For the use of rust to write wasm module and the use […]