Garry's Mod Wiki

Revision Difference

string.GetFileFromFilename#560360

<function name="GetFileFromFilename" parent="string" type="libraryfunc"> <description>Returns file name and extension.</description> <realm>Shared and Menu</realm> <file line="166">lua/includes/extensions/string.lua</file> <file line="166-L173">lua/includes/extensions/string.lua</file> <args> <arg name="path" type="string">The string eg. file-path to get the file-name from.</arg> </args> <rets> <ret name="" type="string">File name or unmodified string.</ret> </rets> </function> <example> <description>Returns the file name.</description> <code>print( string.GetFileFromFilename( "garrysmod/lua/modules/string.lua" ) )</code> <output>string.lua</output> </example>