Garry's Mod Wiki

Garry's Mod Wiki

  string string.Interpolate( string str, table lookuptable )

Description

Interpolates a given string with the given table. This is useful for formatting localized strings.

Arguments

1 string str
The string that should be interpolated.
2 table lookuptable
The table to search in.

Returns

1 string
The modified string.

Example

Example on how to use this function.

local tbl = { ["Name"]= "Jerry" } print( string.Interpolate( "Hello {Name}!", tbl ) )
Output:
Hello Jerry!

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...