You need to sign in to do that
Don't have an account?

how to Sum the string number
i have a variable name countdays
String Countdays = ' ' ;
in debug it is having values like this
========CountDays===========40,40,40,39,39,39 and so on
how to sum it and get the total i.e = 40+40+40+39+39+39....... =
please share your ideas with me
Convert it to Integer and them Sum it.
String a;
Integer d = Integer.ValueOf(a);
If this is the solution, kindly mark this as the solution.
Nisha
This may solve your issue
String allNumber="10,20,20,10";
integer tot=0;
List<String> sinNum =allNumber.split(',');
for(String d:sinNum)
{
tot=tot+Integer.ValueOf(d);
}
May this solve your issue
Thanks
Anil