I have a string which is stored as a cookie.
The string is made up of the following data:
A user can have a number of these, so I store them like this "userId,expiryDate$userId,expiryDate"
When I retrieve the cookie value, I then split the string and add it to a list
The list is List<OpenReviews> openReviews, which contains the two variables above.
I use the following piece of code to split the string:
string reviews = value.Split( '$' ).Select( f => f.Split( ',' ) ).ToArray();
As you can see it goes to an array which I then have to iterate through to add it back into my list. All of which seems extremely long winded.
I believe I can use the code above to put it into an IEnumerable<IEnumerable<string>> format. The problem is I don't know how to then get it into my List<OpenReviews>
I'm therefore looking at getting the split string into my OpensReviews list as efficiently as possible.
View Complete Post