使用经典ASP的字符串到数组

0 arrays asp-classic

我在Classic ASP中有以下代码:

Dim objHttp, strQuery
strQuery = "https://geoip.maxmind.com/f?333l=2112212&i=" & ipaddress
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "GET", strQuery, false
objHttp.send

Response.Write objHttp.ResponseText
Set objHttp = Nothing
Run Code Online (Sandbox Code Playgroud)

这是来自MAxMind的API,用于获取每个IP的用户的城市/邮编.它正在工作,但我得到一个这样的长队:

美国,加州,洛杉矶,90068,34.134499,-328.190804,673,818,"AT&T U-verse"

我知道如何打破这一行并从中获取某些价值观?

pee*_*pee 6

theArray = Split(objHttp.ResponseText,",")

for i=0 to uBound (theArray)
  response.write theArray(i)
next
Run Code Online (Sandbox Code Playgroud)

试试吧.如果字符串始终采用相同的格式,您只需说出即可获得第4个元素theArray(3)