Garry's Mod Wiki

string.StripExtension

  string string.StripExtension( string path )

Description

Removes the extension of a path.

Arguments

1 string path
The string eg. file-path to strip the extension.

Returns

1 string
File-path without extension or unmodified string.

Example

Demonstrates the use of string.StripExtension

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