My combobox has list in the form of "COM9 – XXXXXX XXXX".
I wish to take just the "COM9" so I can use it to connect to the serialport. How may this be done?
Split() the first space-character – no RegEx required
string result = "COM9 - XXXXXX XXXX".Split().First();