var items = new List<string>();
foreach (var item in c.Items.Cast<string>())
{
foreach (var split in item.Split(','))
{
items.Add(split);
}
}
c.Items.Clear();
c.Items.AddRange(items.Distinct().ToArray());
c.Items.Cast<string>().ToList().ForEach(item => item.Split(',').ToList().ForEach(split => items.Add(split)));
MySecondForm msf = new MySecondForm(i);
int i;
public MySecondForm(int _i){
i = _i;
}
максимально просто
try {
dynamic json = JsonConvert.DeserializeObject<dynamic>(response);
string myValue = json.suggestions[0].value.ToString();
}
catch (JSONException je){
// handle
}
Graphics g;
Paint += Draw;
void Draw(object sender, PaintEventArgs e)
{
g = e.Graphics;
}
if (score >= 1000 && score < 1000000)
scoreText.Text = (score / 1000f).ToString() + "k";
else if (score >= 1000000 && score < 1000000000)
scoreText.Text = (score / 1000000f).ToString() + "m";
else scoreText.Text = score.ToString();
GameObject GO = Instantiate(...);
GO.GetComponent<MyScript>().myVariable = ...;