| Usuario |
sobre cadena de caracteres |
informix
1 Mensaje(s)
|
| Enviado - 14/6/2003 |
| |
| Hola amigos necesito un poco de ayuda sobre las cadenas de caracteres quiero que elimine los caracteres repetidos por ejemplo si la palabra es SECRET que solo deje SECRT lo estoy haciendo en VB pero ando un poco trabado en eso espero me puedan orientar |
| |
|
Desconocido
|
| Enviado - 17/6/2003 |
| |
Si nadie te contesta y todavia necesitas ayuda, puedes ir al foro http://programado.foro.st ahi te podre ayudar...
Hasta pronto... |
| |
|
PepeGrillo
46 Mensaje(s)
|
| Enviado - 20/6/2003 |
| |
BUENO MIRA FIJATE SI CON ESTO LO SOLUCIONAS
SE PODRIA HACER DE OTRA MANERA POR AHI SIN NECESIDAD DE RECORRER DOS VECES PERO BUEHHHH
Private Function DevolverCadena(sString As String) As String
'METO CADA LETRA DEL STRING EN UN VECTOR
Dim LongitudCadena As Integer
Dim LongitudVector As Integer
Dim Vector() As String
Dim VectorPosicionesRepe() As Integer
Dim LetraAnt As String
Dim i As Integer
Dim z As Integer
Dim k As Integer
Dim J As Integer
Dim H As Integer
Dim b As Integer
LongitudCadena = Len(sString)
For i = 0 To LongitudCadena - 1
ReDim Preserve Vector(i)
Vector(i) = Mid(sString, i + 1, 1)
Next i
'YA TENGO EL VECTORCITO CON LAS LETRAS
i = 0
LongitudVector = UBound(Vector)
For J = 0 To LongitudVector
For i = J To LongitudVector - 1
LetraAnt = Vector(J)
If Vector(i + 1) = LetraAnt Then
z = z + 1
ReDim Preserve VectorPosicionesRepE(z)
VectorPosicionesRepe(z) = i + 1
Exit For
End If
Next i
Next J
For H = 0 To UBound(Vector)
For b = 0 To UBound(VectorPosicionesRepe) - 1
If H = VectorPosicionesRepe(b + 1) Then
Vector(H) = ""
End If
Next b
DevolverCadena = DevolverCadena + Vector(H)
Next H
End Function
|
| |
|