Q:

Sum numbers on string

Am using C#
I have string of numbers  that are separate with ','like ...
"3,2,2,1,2,1,2"
I want to sum the numbers on the string , how to do that ...in simple way ? 
3+2+2+1+2+1+2=13
any idea ?  
here my code ...my string is SupplierAnswer but it dose not work
Grad is Int
SupplierAnswer is string
      StringBuilder strb = new StringBuilder();

        if (_Project. ProjectRequirements ! = null)
        {
            foreach (Requiernments Req in _Project. ProjectRequirements)
            {
                strb. Append(Req. SupplierAnswer + ",");
                this. AddRequirement(Req);
            }

            this. SupplierAnswers = strb. ToString();

           this. Grad = SupplierAnswers. Split(',').Select(c => int. Parse(c)).Sum(); 

            this. SupplierAnswers =   this. SupplierAnswers. Remove(this. SupplierAnswers. Length - 1);
        }

A:

Use Split to separate your string into many strings, and then use Int32.Parse to convert these strings to integer.  Then, use the Sum method to this list of integer. 
Very simple with Linq ! 
String example = "3,2,2,1,2,1,2";
Int32 sum = example. Split(new char[] { ',' })   // get the "list" of strings
                   .Select(n => Int32.Parse(n)) // get the "list" of integers
                   .Sum();                      // get the sum

