|
rdouglass -> RE: Splitting a string twice (4/23/2008 10:12:40)
|
This code: ReDim array2Dim(2,ubound(array))
For i = 0 To ubound(array)
tempArray = split(array(i),"*")
for j = 0 To 2 'or we could use ubound(tempArray)
array2Dim(j,i) = temparray(j)
Next
Next
should replace this code: ReDim array2Dim(1,ubound(array))
For i = 0 To ubound(array)
array2Dim(0,i) = left(array(i),instr(array(i),"*")-1)
array2Dim(1,i) = mid(array(i),instr(array(i),"*")+1)
Next
You'd grab your values the same way except you'd add a 3rd item in there: For i = 0 To ubound(array2Dim,2) Response.write (array2Dim(1,i) & " " & array2Dim(1,i) & " " & array2Dim(2,i) & "<br />") Next See, a 2 dimensional array can be thought of like a spreadsheet. You access each cell by specifying the column number and rownumber like so: array(column,row) but being sure to remeber that arrays are "0-based" meaning the first cell is array(0,0) and not array(1,1) That help any?
|
|
|
|