Lua 字符串分割:提取URL地址
在Lua中可以使用string.match函数来实现字符串分割。你可以使用以下代码来获取你想要的结果:
local str = 'http://192.168.200.200:80/version.xml'
local result = string.match(str, 'http://([^/]+)')
print(result)
输出结果为:192.168.200.200:80
原文地址: https://www.cveoy.top/t/topic/qoCH 著作权归作者所有。请勿转载和采集!