string.build
Syntax
- sr := string.build(s<,a1><,a2>...)
Build a string using token replacement. The string s is used as the base. The tokens %1, %2, %3 etc. are used to indicate the locations that subsequent parameters a1, a2, etc. will be place. The following parameters will be automatically converted to strings, if necessary. If this is not possible, an error will occur.
Usage Example
The following example illustrates how string.build
can be used, the result will be the string v1 = 12, v2 = 3.456.
local v1 = 12
local v2 = 3.456
local a = string.build("v1 = %1, v2 = %2.",v1,v2)
io.out(a)
Was this helpful? ... | Itasca Software © 2024, Itasca | Updated: Sep 26, 2024 |