ferron

Ferron is a fast and simple static website generator made with Lua.
Log | Files | Refs | Submodules | README | LICENSE

commit 1af81666ab510d076d7b02ec3f346eb51e66f120
parent b73b870816f95440917736de044052afb141a52e
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sat, 20 Jan 2018 13:22:05 -0500

Add a string charAt() function.

Diffstat:
Mfunctions/string-utils.lua | 15+++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/functions/string-utils.lua b/functions/string-utils.lua @@ -1,17 +1,8 @@ -- local stringutils = {} ---print(string.gsub("J'aime à parler ô grace à toi", "à", "a")) - --- ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝàáâãäåæçèéêëìíîïðñòóôõöùúûüýþÿ - --- local charstable = { --- "ÀÁÂÃÄÅ" = "A", --- ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝàáâãäåæçèéêëìíîïðñòóôõöùúûüýþÿ - - - - --- } +function string:charAt(index) + return string.sub(self, index, index) +end return stringutils