I have the following code:
string startAlpha = "A";
string StartSubAlpha = "a-e";
var currentPage = Directory.GetFiles(filePath, startAlpha + "*.pdf")
.Skip((pageNum - 1) * pageSize)
.Take(pageSize)
.Select(path => new FileInfo(path)).ToArray();
This works when only using startAlpha. But how can I integrate StartSubAlpha into it? I want to be able to find all files that has a starting letters (first 2) between "Aa-Ae" (from the example above).
Any suggestions?
There is a very similar question here.
The regex you’re looking for could be formulated as
A[a-e].*