I am currently using this to convert a List of booleans to a string
var tempbllist = new List<int>();
foreach (var t in blenabled)
switch (t)
{
case true:
tempbllist.Add(1);
break;
case false:
tempbllist.Add(0);
break;
}
Settings.Default.blEnabled = String.Join(",",
tempbllist.Select(i => i.ToString(CultureInfo.InvariantCulture)).ToList());
(converts them to 1s and 0s to save space)
and this to convert them back
if (Settings.Default.blEnabled.Contains(","))
blenabled =
new List<bool>(
Settings.Default.blEnabled.Split(',').Select(Int32.Parse).Select(i => i == 1).ToList());
What is a better way of doing this?