Go to: Synopsis. Return value. MEL examples.

Synopsis

basename(string $path, string $suffix)

Strips from $path any prefix ending in '/'. If $path ends in a '/' it is first stripped. If $suffix is not empty, $suffix will also be stripped if it exists at the end of $path. On Windows, the input $path is first processed to convert all backslashes ('\', input as "\\") to '/'s.

Return value

None

Arguments

Variable Name Variable Type Description
$pathstringPath string to strip
$suffixstringSuffix to strip off

MEL examples

	string $path = "/usr/people/gamera/gamera.mel";
	string $basename = basename( $path, ".mel" );
	// Result: gamera //
  basename( $path, "" );
	// Result: gamera.mel //
  string $ntPath = "C:/aw/godzilla/hello.c";
	basename( $ntPath, ".c" );
	// Result: hello //