I’m trying to break down this string into 2 colours and wondered if there is a neater way of achieving the same result?
// Obtain colour values
string cssConfig = "primary-colour:Red, secondary-colour:Blue";
var parts = cssConfig.Split(',');
var colour1 = parts[0].Split(':')[1];
var colour2 = parts[1].Split(':')[1];
You could use regex
Also you could do something with LINQ
There is probably a better way with LINQ!