1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| function urlFormat(url) url=tostring(url) if string.sub(url,0,7)=='http://' or tostring(string.sub(url,0,8))=='https://' then if string.sub(url,#url,#url+1)=='/' then urln=string.sub(url,0,#url-1) else urln=url end else urln='http://'..url end return urln end
print(urlFormat('jiecs.top/'))
|