Skip to content

格式

typescript
File.GetParent(path)

所属类: File

描述

获取指定路径的父文件夹名字。

参数

参数名类型描述
pathstring指定路径

返回值

类型描述
string父文件夹名字

代码示例

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