natiny.script.to_string
natiny.script.to_string(value) -> string|nil
Reads a value as a string, and gives nil for anything that is not one.
Parameters
| Name | Type | Description |
|---|---|---|
value |
any |
What to read |
Returns
| Type | Description |
|---|---|
string |
The string, or nil |
Example
local title = natiny.script.to_string(
natiny.script.table_get(mod, config, "title"))
print(title or "untitled")