I currently have:
string settings = "setting1:value1;setting2:value2";
string[] pair;
foreach(string setting in settings.Split(';'))
{
pair = setting.Split(':');
MessageBox.Show(pair[0] + ":" + pair[1]);
}
I would something more along the lines of:
string settings = "setting1:value1;setting2:value2";
foreach (string[] pair in string setting.Split(':') in settings.Split(';'))
{
MessageBox.Show(pair[0] + ":" + pair[1]);
}
The two in keywords seem a bit ridiculous, but I would think something like this would be possible and very easy, I just don’t know how.
So, is it possible?
I’m not sure this is more readable, but you asked for it and I think it looks cool 😉
(I haven’t compiled it, so I’m sorry if there are syntax errors)