Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing characters from string
Message
From
15/02/2002 16:01:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Removing characters from string
Miscellaneous
Thread ID:
00620890
Message ID:
00620890
Views:
58
hey everyone,
here is my problem. i have a table field with some data (stating the obvious has always been a gift). what i am trying to do is trim certain data within the field. an example is as follows:

table field data: exampleofdata-1234

what i want to do is trim the right side so that the data within the data field just says:
exampleofdata.

i am able to determine whether or not the data has the hyphen with a statement like:
if right(rtrim(substr(table.field, 1, 25)),5) = '-'

what i cannot figure out is how to get rid of those last 5 characters from the string.

the substr is for 25 spaces because all the data in the field is not uniform and i need to perform this check on all the within that field. can anyone help me with this problem. if it seems unclear to anyone, i will be more than happy to try to explain it again. i know it reads kind of confusing. any help is appreciated. thanks.

james
Next
Reply
Map
View

Click here to load this message in the networking platform