Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What would be the easiest way to replace chars. in a str
Message
From
08/02/2000 08:36:34
 
 
To
07/02/2000 17:18:55
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00327059
Message ID:
00328709
Views:
20
>>I have a string that could contain one or more dates. The thing is that those date are of type character.
>>
>>How could I replace those dates in this string by their equivalent representation in date format
>>
>>Exemple:
>>
>>"AADSE 1999/11/28 ASDF 1999/10/29
>>
>>becomes
>>
>>"AADSE {^1999-11-28} ASDF {^1999-10-29}"
>>
>>
>>Is there a VFP function that would make it possible to do this?
>>If not what would be the easiest way?
>
>PMFJI so late, but I'd handle it like this:
>
>for i=words(s) to 1 step -1
> lcStr=wordnum(s, i)
> if ctod(lcStr)#{}
> lcNstr='{^'+lcStr+'}'
> s=strtran(s, lcStr, lcNstr)
> endif
>endd
>
>Of course, I assumed Set Library to FoxTools :)

Thank you Dragan.
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform