更新时间:2022-10-15 11:50:22
Directory.GetFiles(mypath中的* .txt)
。选择(Path.GetFileNameWithoutExtension)
。选择(p =指p。子(1))//每评论
Im looking for a way to read ALL txt files in a directory path without their extensions into an array. Ive looked through the path.getFileNameWithoutExtension but that only returns one file. I want all the *.txt file names from a path i specify
THanks
Directory.GetFiles(myPath, "*.txt")
.Select(Path.GetFileNameWithoutExtension)
.Select(p => p.Substring(1)) //per comment