Skip to content

format

typescript
Directory.GetParent(path)

class: Directory

description

Returns the name of the parent folder of the specified directory.

parameter

param_nametypedescription
pathstringThe specified directory.

return

typedescription
stringThe 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);
	}
}