Video-Converter-In-Blazor/BlazorApp1/Helpers/FileHelper.cs
2025-01-31 11:16:42 +01:00

15 lines
412 B
C#

namespace BlazorApp1.Helpers;
public static class FileHelper
{
public static string RemoveFileEnding(this string fileName)
{
int endingIndex = fileName.LastIndexOf('.');
return fileName.Remove(endingIndex);
}
public static string GetFileNameFromPath(this string path)
{
return path.Split('/')[^1]; // "Index from end expression". Same as final.length - 1
}
}