jeudi 27 août 2015

find a string in list with if and do until

i am more than 100 true or false value in list . i have get the true in a array in order where if a false value comes it has to create a separate array and store value true value after the false value until another false value. i write the program like this to put the true value . any suggestion ?

Dim array1 As New List(Of String)()
For Each var As String In numbers
   If var = "true" Then
      Do
        array1.Add(var)
        numbers.IndexOf(var + 1)
      Loop Until var = "false"
   End If
Next  

Aucun commentaire:

Enregistrer un commentaire