Garry's Mod Wiki

Revision Difference

string.StripExtension#551118

<function name="StripExtension" parent="string" type="libraryfunc"> <description>Removes the extension of a path.</description> <realm>Shared and Menu</realm> <file line="129">lua/includes/extensions/string.lua</file> <file line="137">lua/includes/extensions/string.lua</file> <args> <arg name="Inputstring" type="string">The path to change.</arg> <arg name="path" type="string">The string eg. file-path to strip the extension.</arg> </args> <rets> <ret name="" type="string">Modifiedstring</ret>⤶ <ret name="" type="string">File-path without extension or unmodified string.</ret>⤶ </rets> </function> <example> <description>Demonstrates the use of string.StripExtension</description> <code>MsgN(string.StripExtension("garrysmod/lua/modules/string.lua"))</code> <output>"garrysmod/lua/modules/string"</output> </example>