util.KeyValuesToTable
From GMod Wiki
Function | |
Syntax |
util.KeyValuesToTable( String text ) Where is this used? |
Description: | |
Returns a table formatted in a key-value style string. | |
Returns: | Table |
Part of Library: | Util |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Util.KeyValuesToTable]Util.KeyValuesToTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Additional Notes
- Keys seem to get transformed into lowercase even when they were uppercase before.
- You can't save numbers in your table with this, as all keys and values are converted to strings. This can be fixed by putting a tonumber() around the table indexes.
- This method of data storage is now considered deprecated. It is recommended to use GLON. GLON can encode all types of data and does not return keys as lowercase. Unfortunately, the encoded data is no longer human-readable, but this only means the files can't be edited externally - it is much more efficient in all other manners. Remember to use the require"glon" function.