Ver Mensaje Individual
  #2  
Antiguo 30-12-2010
cloayza cloayza is offline
Miembro
 
Registrado: may 2003
Ubicación: San Pedro de la Paz, Chile
Posts: 915
Reputación: 23
cloayza Tiene un aura espectacularcloayza Tiene un aura espectacular
A la rapida escribi este codigo, prueba y me cuentas...

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);

   Function GetCodigo(AText:String; ASep:Char):string;
   var
      j:Integer;
      List:TStrings;
   begin
        List:=TStringList.Create;

        List.Clear;
        List.Delimiter    :=ASep;
        List.DelimitedText:=ReplaceStr( AText,' ','');

        Result:='';

        for j := 0 to List.Count - 1 do
        begin
            if Length(List[j])<3 then
               Result:=Result+List[j]
            else
                Result:=Result+Copy(List[j],1,3);
        end;
        Result:=UpperCase(Result);
        List.Free;
   end;

begin
     ShowMessage( GetCodigo('COCA COLA/LIGHT /BOTELLA/PLASTICA / Lts / 2.5', '/') );
end;

Saludos cordiales
Responder Con Cita