【发布时间】:2015-01-31 11:00:11
【问题描述】:
跟进我之前的问题(此处链接:Lua How to create custom function that can be used on variables?),有没有办法创建适用于表格以外的其他事物的相同类型的函数?例如,
str = "stuff"
letter = str:foo() --Maybe have the foo function extract the first letter?
有没有办法创建一个以相同方式工作的函数
lowerCasestr = str:lower()
有效吗?
【问题讨论】: