Código Delphi [-] var S: String; begin S := '12.345.126-K'; Delete(S, 3, 1); Delete(S, 6, 1); Delete(S, 9, 2); if StrToIntDef(S, -1) = -1 then ShowMessage('Formato incorrecto') else ShowMessage(S); end;
var S: String; begin S := '12.345.126-K'; Delete(S, 3, 1); Delete(S, 6, 1); Delete(S, 9, 2); if StrToIntDef(S, -1) = -1 then ShowMessage('Formato incorrecto') else ShowMessage(S); end;