Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stumped
Message
De
23/04/1998 17:13:02
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00094441
Message ID:
00094491
Vues:
26
>My brain must be fried today or something. What is the command to obtain the location of the rightmost character(other than a space) in a field. Example, a 25 character field with city and state separated by a space between city and state. If I grab the last two valid characters in the field, I have the state. I can't use the AT function because some cities are two words.
>
>HELP. I know that this is a no brainer! Thanks everyone
>
>Bill
Bill,
Nice solutions so far. Since complexity pays more, try these also :
*Find state
cState = substr(myField,rat(" ",alltrim(myField))+1)
cCityOnly = substr(myField,1,rat(" ",alltrim(myField))-1)
* or more payment
cCityOnly = stuff(myField,rat(" ",alltrim(myField))),len(myField),"")
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform