Skip to content

格式

typescript
Directory.GetParent(path)

所属类: Directory

描述

返回指定目录的父文件夹名。

参数

参数名类型描述
pathstring指定目录

返回值

类型描述
string父文件名

代码示例

javascript
function Test() {
	try {
		const file_path: string = "D:/TestingResources/ttt"
		let parent_path = Directory.GetParent(file_path);
		Debug.log(parent_path); // D:/TestingResources
	} catch (error) {
		Debug.Error(error);
	}
}