locked
Splitting an Array RRS feed

  • Question

  • User234419341 posted

    I have a string delimited by a space and I would like to pass each value to a stored procedure.

    Currently I am using:

    Dim MyString As String = Me.lblStr.Text
    Dim myStringArray As String() = MyString.Split(" ")
    Dim i As Integer
    
    For i = LBound(myStringArray) To UBound(myStringArray)
         translateStr(MyString(i))
    Next
    The string going in is "A9 A10 B1" but the string be passed to the translateStr object are A, 9, A, 1, etc. How can I get it to pass each set of characters? 
    Wednesday, April 9, 2008 3:03 PM

Answers

  • User437720957 posted

    You're using the wrong variable

     translateStr(myStringArray(i))

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 9, 2008 5:08 PM