findFilesByExtension

Finds all files in a directory that end with the given extension text.

string[]
findFilesByExtension
(
string dir
,
string extension
,
bool recursive = true
,
int maxDepth = -1
)

Parameters

dir string

The directory to search in.

extension string

The extension for matching files, such as ".txt" or ".d"

recursive bool

Whether to recursively search subdirectories.

maxDepth int

How deep to search recursively. -1 indicates infinite recursion.

Return Value

Type: string[]

The list of matching files.

Meta