I want to parse this string in C# and get the values for User, BusinessNameId, ToBusinessNameId, PatientId and ToProviderId
User: firstname.lastname@example.org BusinessNameId: 1973 ToBusinessNameId: 1973 PatientId: 1506 ToProviderId: 1608
I think I need to use IndexOf
string test = "User: email@example.com BusinessNameId: 1973 ToBusinessNameId: 1973 PatientId: 1506 ToProviderId: 1608"
s.IndexOf('User:") but then how do I get firstname.lastname@example.org that comes right after it?
s.IndexOf("BusinessNameId") but how do I get 1973 ?
There will always be a space between the strings (I can use * or any other character if it's better. It doesn't have to be a space)