ToString converts the Lua value at index to a Go string. The Lua value must also be a string or a number; otherwise the function returns false for its second return value. http://www.lua.org/manual/5.2/manual.html#lua_tolstring
(index int)
| 798 | // |
| 799 | // http://www.lua.org/manual/5.2/manual.html#lua_tolstring |
| 800 | func (l *State) ToString(index int) (s string, ok bool) { |
| 801 | if s, ok = toString(l.indexToValue(index)); ok { // Bug compatibility: replace a number with its string representation. |
| 802 | l.setIndexToValue(index, s) |
| 803 | } |
| 804 | return |
| 805 | } |
| 806 | |
| 807 | // RawLength returns the length of the value at index. For strings, this is |
| 808 | // the length. For tables, this is the result of the # operator with no |