Link to home
Start Free TrialLog in
Avatar of wildzero
wildzero

asked on

Copy some text from a string

I got this text inside a string

Description:</STRONG>something another something
more something<p> and yes more<BR><BR><BR>

What I want to do is copy the text between :</STRONG> and <BR> so I would get
something another something more something and yes more

So I think I need the position of
Description:</STRONG>
Then +1 the position until I get to <BR> then select that text and copy it.

the text between those two points will be different all the time....

Thanks guys!
SOLUTION
Avatar of BlackTigerX
BlackTigerX

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
ASKER CERTIFIED SOLUTION
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
// try this ...

function YourExtract(FromThis: String): String;
var
  s1: string;
begin
  delete(FromThis,1,pos('</STRONG>',FromThis)+9);

  s1:=copy(FromThis,1,pred(pos('<BR>',FromThis)));
  while pos('<p>',s1)<>0 do delete(s1,pos('<p>',s1),3);

  result:=s1;
end;

Avatar of wildzero
wildzero

ASKER

Thanks :D
Used a combination of the two!