Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Chopping characters
Message
From
02/07/2005 06:10:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01027078
Message ID:
01028464
Views:
10
>Does anybody know how I can programmatically chop characters off at the first space within a value. For example if the value is Morocco Tops then I want to see Morocco and if the value is Turkish Fabric then it should say Turkish.
>
>Any help would be greatly appreciated

The function at() do what you need.
Ex:
x = "My String"
y = at(" ", x)
z = substr(x,1, y - 1)

or

x = "My String"
z = substr(x, 1, at(" ", x) - 1)

Joaquim
Previous
Reply
Map
View

Click here to load this message in the networking platform