parse text into key/value pair or json
===

I have text in the following format, I was wondering what the best approach might be to create a user object from it with the fields as its properties.

I dont know regular expressions that well and i was looking at the string methods in csharp particularly IndexOf and LastIndexOf, but i think that would be too messy as there are approximately 15 fields.

I am trying to do this in c sharp

Some characteristics:

1.) The keys/fields are fixed and known beforehand, so i know that i have to look for things like title, company etc

2.)The address part is single valued and following that there's some multi-valued fields

3.)The multi-valued field may/maynot end with a comma (,)

4.) There is one or two line brakes between the fields eg "country" is followed by 2 line brakes before we encounter "interest"


---------------------------------------------

Title: Mr

Company: abc capital

Address1: 42 mystery lane

Zip: 112312

Country: Ireland


Interest: Biking, Swimming, Hiking,


Topic of Interest: Europe, Asia, Capital