Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pickup first characters in a string
Message
 
To
23/08/2002 12:28:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00692996
Message ID:
00693006
Views:
30
Thank You

>
>
>xx="Chief Probation Officer"
>?acronym(xx)
>
>FUNCTION Acronym(tcValue)
>   LOCAL lnSpaces, lcRetVal, lni
>   lnSpaces = OCCURS(" ",tcValue)
>   lcRetVal = LEFT(tcValue,1)
>   FOR lni = 1 TO lnSpaces
>   	  lcRetVal = lcRetVal + SUBSTR(tcValue,AT(" ",tcValue,lni)+1,1)
>   NEXT
>   RETURN lcRetVal
>
>
>
>>I am trying to pick out first character in a string for example:
>>
>>Chief Probation Officer
>>
>>I need to return
>>
>>CPO
>>
>>
>>I there a quick way of doing this, I will need to perform this operation on hundreds of strings. If there is no straight forward way of doing this then do I put each character in an array and search the array ?
>>
>>Thanks
>>Nick Patel
Previous
Reply
Map
View

Click here to load this message in the networking platform