nanos world API Reference Unofficial documentation
Function Shared

string.FormatArgs

A better string.Format, replace <code>{num}</code> by the corresponding vararg in a string

Syntax

Lua
string.FormatArgs(args)

Parameters

Name Type Default Description
args any... The args

Returns

  • string

Examples

Replaces {1} and {2} with corresponding texts
local str = "Hello {2} I'm {1}",local new_str = str:FormatArgs("a noob", "world!")