Format

From NSB App Studio
Revision as of 16:40, 2 April 2014 by Admin (talk | contribs)
Jump to navigation Jump to search

Format(string, replace0[,replace1...])

Description

Replaces {n} placeholders with arguments. One or more arguments can be passed, in addition to the string itself, to insert into the string.

Example (Basic)

Print Format("1{0}2","a")
Print Format("My name is {0} and I live in {1}.", "Cartman", "South Park")

Example (JavaScript)

NSB.Print(Format("1{0}2","a"));
NSB.Print(Format("My name is {0} and I live in {1}.", "Cartman", "South Park"));

Output

1a2
My name is Cartman and I live in South Park.