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