using System; using System.Linq; namespace Solution{ public class ToAsci { public static int getAsciSum(string s) => s.ToList().Sum(e => (int)e); } }
- using System;
- using System.Linq;
- namespace Solution{
- public class ToAsci
- {
public static int getAsciSum(string s){int returner = 0;foreach (var el in s)returner += (int)el;return returner;}- public static int getAsciSum(string s) => s.ToList().Sum(e => (int)e);
- }
- }