none
Modificar codigo RRS feed

  • Pregunta

  •         Dim MatchWord As String = "taca"
            Dim WordsToSearch As New List(Of String)(New String() {"acat", "cata", "taca", "aact", "tacaa", "act", "scat", "cat"})
            Dim Matches As New List(Of String)
    
            For Each word As String In WordsToSearch
                If word.Length = MatchWord.Length Then
                    Dim IsMatch As Boolean = True
                    Dim copy As String = MatchWord
                    For Each c As Char In word
                        Dim idx As Int32 = copy.IndexOf(c)
                        If idx <> -1 Then
                            copy = copy.Remove(idx, 1)
                        Else
                            IsMatch = False
                            Exit For
                        End If
                    Next
                    If IsMatch Then
                        Matches.Add(word)
                    End If
                End If
            Next
    
            Dim msg As String
            For Each s As String In Matches
                msg = s
                Datos.LbxPosibles.Items.Add(msg & vbNewLine)
            Next

    Pueden ayudarme a cambiar ese codigo para que en vez de buscar en el Array busque en un archivo de texto?

    Por fabor, tengan en cuenta que es para Net Compact Framework.

    Muchisimas gracias.


    Rafael FM

    jueves, 11 de julio de 2013 13:17