I am working on a project where i need to Iterate through every line in a txt file and find where its says .csproj and get the name of the csproj
C:\DataTypes\Nameofthecsproj.csproj this is what it looks like in txt file so i need to remove "C:\Datetypes\ until i only have: Nameofthecsproj.csproj
foreach (string line in File.ReadAllLines(FILEPATH))
{
if (line.Contains(".csproj"))
{
Match result = Regex.Match(line, @"^.*?(?=csproj)");
}
}
I just need a way to filter out the rest until i only have Nameofthecsproj.csproj