Skip to content

format

typescript
File.GetParent(path)

class: File

description

Get the name of the parent folder for the specified path.

parameter

param_nametypedescription
pathstringThe specified path.

return

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