09-08-2012, 10:25 AM
// Splits the string in parts on every occurance of -
string[] splitted = listBox1.Text.Split('-');
string name = splitted[0].Trim();
int id = int.parse(splitted[1].Trim());
Ofcourse this will give a problem when there is a character with a - in the name
int id = int.parse(splitted[splitted.Length - 1].Trim());

