format
typescript
Directory.GetParent(path)class: Directory
description
Returns the name of the parent folder of the specified directory.
parameter
| param_name | type | description |
|---|---|---|
| path | string | The specified directory. |
return
| type | description |
|---|---|
string | The name of the parent folder. |
code example
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);
}
}