int total = 0; total = int.Parse(button1.Text) + int.Parse(button2.Text) + int.Parse(button3.Text) + int.Parse(button4.Text) + int.Parse(button5.Text) + int.Parse(button6.Text) + int.Parse(button7.Text) + int.Parse(button8.Text) + int.Parse(button9.Text) + int.Parse(button11.Text); textbox.Text = total.ToString();
int total = 0; foreach (char ch in this.textBox1.Text) { total += int.Parse(ch.ToString()); } this.textBox1.Text = total.ToString();
string mytext = "1020"; int sumOfChars = mytext.Sum(x=>Convert.ToInt32(x.ToString())); //3
int num = "1020".Sum(n => n & 15); int sum = (int)"1020".Sum(n => Char.GetNumericValue(n));
char
string
int
double
\u00BC
\u00BD
\u00BE
txtTotal.Text = (float.Parse(txtbox1.Text) + float.Parse(txtbox2.Text)).ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)