/// <summary> /// 获取文件名 /// </summary> /// <param name="path"></param> /// <param name="separator"></param> /// <returns></returns> public static string GetFileName(string path, char separator = '/') { path = IOExtension.MakePathStandard(path); return(path.Substring(path.LastIndexOf(separator) + 1)); }
/// <summary> /// 将相对于Asset的路径转换为绝对路径且去除后缀 /// </summary> /// <param name="path"></param> /// <returns></returns> public static string ConvertAssetPathToAbstractPathWithoutExtention(string path) { return(IOExtension.GetFilePathWithoutExtention(ConvertAssetPathToAbstractPath(path))); }
/// <summary> /// 获取文件夹名 /// </summary> /// <param name="fileName"></param> /// <returns></returns> public static string GetDirectoryName(string fileName) { fileName = IOExtension.MakePathStandard(fileName); return(fileName.Substring(0, fileName.LastIndexOf('/'))); }