Link to home
Start Free TrialLog in
Avatar of boycoder
boycoder

asked on

how to cut down a tedit ?

when i paste the following into a tedit..

Item/Product Number:  11068319597887

how would i cut out the word and space: Item/Product Number:  

Just to leave in the editbox the actual number ?

----------

also, the same for this one, to cut out "Buyer's User ID:  "
Buyer's User ID:  ptom1747


I have a few more to do, but if someone can help with these i can do the rest, please please keep it as simple as possible so i can learn from it then i can advance to make it more complex and better.
Avatar of jimyX
jimyX

If the format will always be "xxxxx: ######" then use this code:
procedure TForm1.Button1Click(Sender: TObject);
var
  Str:String;
begin
  Str:=Eit1.Text;
  Str:=Trim(copy(Str,pos(':',Str)+1,length(Str)-pos(':',Str)+1));
  Showmessage(Str);
end;

Open in new window

Avatar of boycoder

ASKER

hah! clever jim that, nice idea of cutting it all before the :

it works, but how would i work it into a better output. Instead of showing messages.
i want to do the following:

DBitem.Text := Memo1.Lines.Strings[3];

The actual item/number: is online 3. I want to put it into DBitem.text
ASKER CERTIFIED SOLUTION
Avatar of jimyX
jimyX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
cheers Jim, first class as always!
A+