see the extension tutorial. it describes all the types:
Wire Expression2 Extension Tutorial
also, try 'return foobar or ""'
will return "" if foobar is nil (or false) and foobar if not.
see the extension tutorial. it describes all the types:
Wire Expression2 Extension Tutorial
also, try 'return foobar or ""'
will return "" if foobar is nil (or false) and foobar if not.
"It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup
Lífið læðist lúmskt áfram
I'm committing these now.
"It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup
Lífið læðist lúmskt áfram
I think an implode and a reverse string function could be useful. I've taken the time to make them, and they work. The reverse()-function returns the string you input reversed, and the implode()-function takes an array and returns all the cells as a string. The opposite of explode.
syntax:
S:reverse()
R:implode(S) or R:implode()
lua Code:
e2function string string:reverse() return string.reverse(this) end e2function string array:implode(string that) if !this then return "" end Tbl = {} for k,v in pairs(this) do table.insert(Tbl,tostring(v)) end return string.Implode(that,Tbl) end e2function string array:implode() if !this then return "" end Tbl = {} for k,v in pairs(this) do table.insert(Tbl,tostring(v)) end return string.Implode("",Tbl) end
we already have implode. it's named concat.
and as I told Jeremydeath before you, E2 strings are never nil, so this check in E:reverse is superfluous.
"It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup
Lífið læðist lúmskt áfram
Ah, ok! Then it's no need for the implode function. Heh, I didn't even know there was such a function.
Bookmarks