c# fileinfo name without extension code example
Example: c# fileinfo filename without extension
DirectoryInfo dir = new DirectoryInfo(path);
FileInfo[] files = dir.GetFiles("*.txt");
foreach (FileInfo file in files)
{
string noExtension = Path.GetFileNameWithoutExtension(file.Name);
}