DTRON04
asked on
Looping a Split Array
I need the proper code to loop a Split Array
Dim BSplit
BSplit = Microsoft.VisualBasic.Spli t(Testing the Split, " ")
I want to split the above then loop through the array 0 1 etc.
Could someone help me out with this.
Dim BSplit
BSplit = Microsoft.VisualBasic.Spli
I want to split the above then loop through the array 0 1 etc.
Could someone help me out with this.
discard the previous one....
Dim BSplit
BSplit = Microsoft.VisualBasic.Spli t(Testing the Split, " ")
for j as inetegr= 0 to upperbond(bsplit)
next
Dim BSplit
BSplit = Microsoft.VisualBasic.Spli
for j as inetegr= 0 to upperbond(bsplit)
next
ASKER
Dim BSplit
BSplit = Microsoft.VisualBasic.Spli t(BName, " ")
For j = 0 To Upperbound(BSplit)
BClean = BClean + "+" + BSplit(j)
Next
This code tells me upperbound has to be declared
BSplit = Microsoft.VisualBasic.Spli
For j = 0 To Upperbound(BSplit)
BClean = BClean + "+" + BSplit(j)
Next
This code tells me upperbound has to be declared
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with idle mind, however I just wanted to add a quick note about performance and the For Each loop.. When you use a For Each loop, an Enumerator object is created behind the scenes. For this reason, you should avoid For Each, and use the For loop indexing method (ie. For i = 0 to n etc.) when complexity/performance is a concern
KGREG
KGREG
i was mentioning it wrong...its UBound and not upperbound....
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks guys
BSplit = Microsoft.VisualBasic.Spli