Ver Mensaje Individual
  #2  
Antiguo 16-03-2020
Avatar de movorack
[movorack] movorack is offline
Miguel A. Valero
 
Registrado: feb 2007
Ubicación: Bogotá - Colombia
Posts: 1.346
Reputación: 22
movorack Va camino a la famamovorack Va camino a la fama
Puedes recorrer uno a uno los caracteres evaluando si es un número.

Código Delphi [-]
function ExtraeNumeros(S: string): Integer;
  var
    i: Integer;
    lStTemp: string;
begin
  Result := 0;
  lStTemp := '';

  for i := 1 to Length(S) do
  begin
    if CharInSet(S[i], ['0'..'9']) then
      lStTemp := lStTemp + S[i];
  end;

  TryStrToInt(lStTemp, Result);
end;

También podrías usar Expresiones regulares
__________________
Buena caza y buen remar... http://mivaler.blogspot.com
Responder Con Cita