Skip to main content

 

MindTouch Success Center

string.format()


Replaces placeholders with values in a string.
 

Parameters


Name Type Description
text str string with placeholders
values any (optional) values to insert into string


Usage


The following table shows argument combinations and their outcome.

text values Result
nil   nil
""   ""
"Hi $0!" [ "Bob", "Charles" ] "Hi Bob!"
"Hi $first!" { first: "Bob", second: "Charles" } "Hi Bob!"
  • Was this article helpful?