string code = "";
string myString = "{ name = tuutusdydfh, code = cs11 }";
myString = myString.Replace("{", "").Replace("}", "").Replace(" ", "");
string[] parts = myString.Split(',');
foreach(string part in parts)
{
if (part.StartsWith("code="))
{
code = part.Replace("code=", "");
break;
}
}
At this point,
code
should be equal to "cs11".