Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing characters from string
Message
De
15/02/2002 16:01:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Removing characters from string
Divers
Thread ID:
00620890
Message ID:
00620890
Vues:
57
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform