Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sum of digits in a string
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here string s = "qwert100ft34"; int sum=0; var x = s.ToCharArray(); Console.WriteLine(x); for( int I=0;I<=x.Length - 1;I++) { if(x[I]>'0' && x[I]<='9') { sum += x[I] -'0'; } } Console.WriteLine(sum); } } }
run
|
edit
|
history
|
help
0
qwerty
linq
Huy kaka
recursion
First pr
conditional Debug
Task1
c++
Math 10.9 edited makeMultQ
Find if the given word occurs in the string necessarily in that order.