Fijate si te sirve algo asi.
Código Delphi
[-]
procedure TForm1.SButtonClick(Sender: TObject);
var
cTxt, cClave, cParcial: String;
nPos, i: Integer;
aCant: Array[0..5] of Integer;
begin
aCant[0] := 3;
aCant[1] := 2;
aCant[2] := 3;
aCant[3] := 3;
aCant[4] := 2;
aCant[5] := 3;
i := 0;
cTxt := 'COCA COLA/LIGHT /BOTELLA/PLASTICA / Lts / 2.5';
cClave := '';
while Length(cTxt) > 0 do
begin
nPos := Pos('/', cTxt);
if nPos = 0 then begin
nPos := Length(cTxt);
cParcial := Copy(cTxt, 0, nPos);
end
else
cParcial := Copy(cTxt, 0, nPos - 1);
cClave := cClave + Copy(Trim(cParcial), 0, aCant[i]);
cTxt := Copy(cTxt, nPos + 1, Length(cTxt) - nPos);
inc(i);
end;
cClave := UpperCase(cClave);
SButton.Caption := cClave;
end;