Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: How to extract a string? Post Reply Post New Topic
Author Message
gilfong
Newbie
Newbie
Avatar

Joined: 24 Sep 2008
Location: United States
Online Status: Offline
Posts: 1
Quote gilfong Replybullet Topic: How to extract a string?
    Posted: 24 Sep 2008 at 10:48am

Example of the data:

Progesterone Receptor (SP2)
Keratin 19 Rabbit PAb
CD22
 
How do I extract the 1st and 2nd word?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 24 Sep 2008 at 12:50pm

There may be a more "elegant" way to do this, but try something like this:

NumberVar x;
x := InStr({table.field}, " ");  //get the position of the first space
x := InStr(x, {table.field}, " ");  //get the position of the second space
Left({table.field}, x-1)
 
Note that there is no semi-colon after the last statement.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.