// Special HasParentDirectory impl for VariablePaths internal static bool HasParentDirectory(string path) { Debug.Assert(path != null); if (!MiscHelpers.HasParentDirectory(path)) { return(false); } var lastName = MiscHelpers.GetLastName(path); // Here, we ensure that there is no variable defined into the last fileName or directoryName! return(!DoesFileNameContainVariable(lastName)); }
internal static string GetFileNameExtension(string path) { Argument.IsNotNull(nameof(path), path); var fileName = MiscHelpers.GetLastName(path); var index = fileName.LastIndexOf('.'); if (index == -1) { return(string.Empty); } return(index == fileName.Length - 1 ? string.Empty : fileName.Substring(index, fileName.Length - index)); }
internal static string GetFileNameExtension(string path) { Debug.Assert(path != null); var fileName = MiscHelpers.GetLastName(path); var index = fileName.LastIndexOf('.'); if (index == -1) { return(string.Empty); } if (index == fileName.Length - 1) { return(string.Empty); } return(fileName.Substring(index, fileName.Length - index)); }
internal static string GetFileName(string path) { Argument.IsNotNull(nameof(path), path); return(MiscHelpers.GetLastName(path)); }
// // FileName and extension // internal static string GetFileName(string path) { Debug.Assert(path != null); return(MiscHelpers.GetLastName(path)); }