So I am making a program and in the program I give the user the option to add Custom Items into the Combobox. To make sure that the Custom Items are still there when the program is restarted I use this code in the form load
Dim customcarrier As New IO.DirectoryInfo(Application.StartupPath & "\CUSTOM\")
Dim carriers As IO.FileInfo() = customcarrier.GetFiles("*.txt")'gets all the custom items in the directory
Dim carrier As IO.FileInfo
For Each carrier In carriers
ComboBox2.Items.Add(carrier)'adds filename into textbox
Next
The problem is that the program adds the whole filename with the extension to the Combobox. Is there any way I can exempt the last 4 char (.txt)
Srry if I am unclear describing is always hard for me.