15 lines
412 B
C#
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
|
|
}
|
|
} |