Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

Lsts1.Clear: Private Sub Cmdseparar - Click

The document contains code to perform several string manipulation tasks on a given input string including: 1. Separating the input string into individual words and adding them to a list. 2. Adding words of length greater than 3 characters from the separated list to another list. 3. Adding words containing "ll" or "con" from the separated list to another list. 4. Capitalizing the first letter of words in the separated list not containing a "/" in the fourth position and adding to another list. 5. Adding words resembling dates in DD/MM/YYYY format from the separated list to another list.

Uploaded by

Richard Peredo
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lsts1.Clear: Private Sub Cmdseparar - Click

The document contains code to perform several string manipulation tasks on a given input string including: 1. Separating the input string into individual words and adding them to a list. 2. Adding words of length greater than 3 characters from the separated list to another list. 3. Adding words containing "ll" or "con" from the separated list to another list. 4. Capitalizing the first letter of words in the separated list not containing a "/" in the fourth position and adding to another list. 5. Adding words resembling dates in DD/MM/YYYY format from the separated list to another list.

Uploaded by

Richard Peredo
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Dim cadena As String Dim tamcad As Integer Dim pal As String Dim cont As Integer Dim vecP(1 To 300)

As String Private Sub cmdseparar_Click() lstS1.Clear cadena = txtcadena.Text tamcad = Len(cadena) Call cargarVec(cadena, tamcad) For i = 1 To cont Step 1 pal = vecP(i) lstS1.AddItem (pal) Next i End Sub Sub cargarVec(cadena As String, tamcad As Integer) Dim pb1 As Integer Dim pb2 As Integer cont = 0 pb1 = InStr(cadena, " ") pal = Left(cadena, pb1 - 1) vecP(1) = pal cont = cont + 1 While (pb1 < tamcad) pb2 = InStr(pb1 + 1, cadena, " ") If (pb2 <> 0) Then pal = Mid(cadena, pb1 + 1, ((pb2 - 1) - pb1)) cont = cont + 1 vecP(cont) = pal pb1 = pb2 Else pal = Mid(cadena, pb1 + 1, tamcad - pb1 + 1) cont = cont + 1 vecP(cont) = pal pb1 = tamcad End If Wend End Sub Private Sub cmdlong3_Click() lstS2.Clear cadena = txtcadena.Text tamcad = Len(cadena) Call cargarVec(cadena, tamcad) For i = 1 To cont Step 1 pal = vecP(i) If (Len(pal) > 3) Then lstS2.AddItem (pal) End If Next i End Sub Private Sub cmdpLL_Click() lstS3.Clear cadena = txtcadena.Text tamcad = Len(cadena) Call cargarVec(cadena, tamcad) Dim p1, p2 As Integer For i = 1 To cont Step 1 pal = vecP(i) p1 = InStr(pal, "ll") p2 = InStr(pal, "con") If (p1 <> 0 Or p2 <> 0) Then lstS3.AddItem (pal) End If Next i End Sub End SubPrivate Sub cmdInMay_Click() cadena = txtcadena.Text tamcad = Len(cadena) Call cargarVec(cadena, tamcad) Dim palM, pal1, pal2, barra As String lstS4.Clear For k = 1 To cont Step 1 pal = vecP(k) barra = Mid(pal, 3, 1) If (StrComp(barr, "/") <> 0) Then pal1 = Left(pal, 1) pal2 = Right(pal, Len(pal) - 1) palM = UCase(pal1) & pal2 lstS4.AddItem (palM) End If Next k End Sub Private Sub cmdformfecha_Click() cadena = txtcadena.Text tamcad = Len(cadena) Call cargarVec(cadena, tamcad) Dim barra1, barra2, ao As String lstS5.Clear For k = 1 To cont Step 1 pal = vecP(k) barra1 = Mid(pal, 3, 1) barra2 = Mid(pal, 6, 1) ao = Mid(pal, 7, 4) If (StrComp(barra1, "/") = 0 And StrComp(barra1, "/") = 0 And Len(ao) = 4) Then lstS5.AddItem (pal) End If Next k End Sub

You might also like