格式
typescript
Directory.GetParent(path)所属类: Directory
描述
返回指定目录的父文件夹名。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| path | string | 指定目录 |
返回值
| 类型 | 描述 |
|---|---|
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);
}
}