i am making an app which has a listbox with all its items ending up in ".txt"
it is a listbox NOT a FileListBox. is there a way to delete the .txt in all items of the list? i have tried a lot of things but.... :eek2:
[Removed by Mod]
Printable View
i am making an app which has a listbox with all its items ending up in ".txt"
it is a listbox NOT a FileListBox. is there a way to delete the .txt in all items of the list? i have tried a lot of things but.... :eek2:
[Removed by Mod]
Or:Code:Private Sub Command1_Click()
Dim i As Integer
For i = 0 To List1.ListCount - 1
If LCase(Right(List1.List(i), Len(".txt"))) = ".txt" Then
List1.List(i) = Left(List1.List(i), InStrRev(LCase(List1.List(i)), ".txt") - 1)
End If
Next i
End Sub
Code:Dim i As Integer
For i = 0 To List1.ListCount - 1
List1.List(i) = Replace(LCase(List1.List(i)), ".txt", "")
Next i
End Sub
@Beasts:
We all be very glad if you can take few seconds more to type full words - this isn't a chit-chat.
In some contries your title might look quite offencive so it would be nice if you change it... ;)
Thanks. :wave:
Thread title on posts modified to reflect thread topic/question.