Garry's Mod Wiki

string.GetFileFromFilename

  string string.GetFileFromFilename( string path )

Description

Returns file name and extension.

Arguments

1 string path
The string eg. file-path to get the file-name from.

Returns

1 string
File name or unmodified string.

Example

Returns the file name.

print( string.GetFileFromFilename( "garrysmod/lua/modules/string.lua" ) )
Output: string.lua