Garry's Mod Wiki

string.GetPathFromFilename

  string string.GetPathFromFilename( string path )

Description

Returns the path only from a file's path.

Arguments

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

Returns

1 string
Path or empty string.

Example

Demonstrates the use of string.GetPathFromFilename

MsgN(string.GetPathFromFilename("garrysmod/lua/modules/string.lua"))
Output: "garrysmod/lua/modules/"