Skip to content

utils.string.parsetpl

utils.string.parsetpl(tpl, data)
This function gets data of a table.

Arguments

Argument Data Type Optional Default Value Explanation
tpl table No - Set the table
data string Yes - Data to replace of table

Dependency

local utils = M("utils")

Example

local myTable = {
    "esx1",
    "esx2",
    "esx3",
}

local str = utils.string.parsetpl(myTable)

print(str) -- Returns esx1esx2esx3
local myTable = {
    "esx2",
    "@esx2",
    "@esx3"
}

data = {esx2 = "is", esx3 = "awesome"}

local str = utils.string.parsetpl(myTable, data)

print(str) -- Returns esx2isawesome

Improve this documentation