Quick question. I have a listbox being populated from a directory listing. Each file contains its name and ~#####. I'm trying to read it all into a string and replace the ~#### with nothing. The #### could be digits from length 1-6 and could be anything from 0-9. Here's the code I'm using:
string listItem = (listBox1.SelectedItem.ToString().Replace("~*",""));
Example:
Here223~123 ---> Here
Here224~2321 ----> Here
I can't replace any number because I need the numbers before the ~