Ver Mensaje Individual
  #2  
Antiguo 11-06-2013
WkaymQ48 WkaymQ48 is offline
Miembro
NULL
 
Registrado: jul 2012
Posts: 43
Reputación: 0
WkaymQ48 Va por buen camino
Que tal así:
Código Delphi [-]
function Suma(Str: String): Integer;
var
  i: Integer;
begin
  Result:= 0;
  for i:= 1 to Length(Str) do
    if Str[i] in ['1','2','3','5','7'] then
      Result:= Result + StrToInt(Str[i]);
end;  

// Por ejemplo
Edit1.Text:= IntToStr(Suma(Edit1.Text));
Responder Con Cita