Spanish Buscar en un list (uso list.IndexOf para 1 elementos) si hay elementos repetidos?

Discussion in 'Spanish Forum' started by deneus, Apr 28, 2015.

  1. deneus

    deneus Member Licensed User

    Hola, quería saber como se puede buscar en un list (uso list.IndexOf para 1 elemento) si hay elementos repetidos?
     
  2. bgsoft

    bgsoft Well-Known Member Licensed User

    hola

    Prueba esto:

    Code:
    For n = 0 To list1.Size-1
      
    If n < list1.Size-1 Then
        
    For t = n+1 To list1.Size-1
          
    If list1.Get(n) = list1.Get(t) Then EstaRepetido ' pon lo que quieras
        Next
      
    End If
    Next
    Antes comprueba que la lista no esté vacia

    Saludos
     
    eurojam likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice