using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
string vendorsString = "City of Harrisonburg <WaterService@harrisonburgva.gov>|HEC <WEB_CSVC@hbgelec.com>|Matchbox-Brian Cowger-TO Center <brian@matchboxrealty.com>|Matchbox-Tasha Browne-TO Center <tasha@matchboxrealty.com>|";
string[] vendorsArray = vendorsString.Split('|', System.StringSplitOptions.RemoveEmptyEntries);
foreach(string vendor in vendorsArray)
int emailIndex = vendor.IndexOf('<');
string vendorName = vendor.Substring(0, emailIndex - 1);
List<string> vendorNames = vendorsString.Split('|', System.StringSplitOptions.RemoveEmptyEntries).Select(x => x.Substring(0, x.IndexOf('<') - 1)) .ToList();
foreach(string vendorName in vendorNames)
Regex rx = new Regex(@"<(.*?)>");
Dictionary<string,string> dVendorNameVendorEmail = vendorsString.Split('|', System.StringSplitOptions.RemoveEmptyEntries)
.ToDictionary(x => x.Substring(0, x.IndexOf('<') - 1), x => rx.Match(x).Groups[1].Value);
foreach(KeyValuePair<string, string> kvp in dVendorNameVendorEmail)
Console.WriteLine(string.Format("{0} {1}", kvp.Key, kvp.Value));