标签:string sub adapter 截取字符串 win winapi ada 替换字符串 str
> aaa=‘/p/v2/api/winapi/adapter/lgj‘
> print(string.find(aaa, "^/.+/adapter/(.*)"))
1 28 lgj
> aaa=‘/p/v2/api/winapi/adapter/lgj/zy/l‘
> print(string.find(aaa, "^/.+/adapter/(.*)"))
1 33 lgj/zy/l
> print(string.gsub(‘lgj/zy/l‘,‘/‘,‘:‘))
lgj:zy:l 2
> print(string.sub(‘lgj/zy/l‘,1,5))
lgj/z
> print(string.find(aaa, ‘"(.+)"‘))
string.find(查找获取字符串) string.gsub(查找替换字符串) string.sub(截取字符串)
标签:string sub adapter 截取字符串 win winapi ada 替换字符串 str
原文地址:https://www.cnblogs.com/lgj8/p/12400603.html