Hi! I input symbols into textbox, but I want get sum its code in C# windows application. For example:
Input: 089abcr!
Output result: 441
Because 0=48,8=56,9=57,a=65,b=66,c=67,r=82. Its symbol can always change. Its variables.
Hi RPA,
Check this example. Now please take its reference and correct your code.
Code
C#
private void btnSum_Click(object sender, EventArgs e) { string value = txtSum.Text; char[] chars = value.ToCharArray(); int total = 0; for (int i = 0; i < chars.Length; i++) { total += (int)chars[i]; } label1.Text = total.ToString(); }
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.