Quote:
Originally Posted by NiLuJe
Nice!
For those crazy people who actually like the Lua syntax... ;p.
|
Just for any Python lovers in the audience ('> ' is the interactive prompt).
Adding the PinLight loader (all PinLight functions are 'load on demand'), then extending the standard string library:
PHP Code:
> require'pl'
> stringx.import()
> url = 'http://amazon.com/customer/complaints.html'
> ut = url:split('/')
> for k, v in ipairs(ut) do print(k, v) end
1 http:
2
3 amazon.com
4 customer
5 complaints.html
> ut[1] = 'https:'
> tt = ut:concat('/')
> print(tt)
https://amazon.com/customer/complaints.html