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
07/02/2000 17:18:55
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
03/02/2000 19:26:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00327059
Message ID:
00328507
Views:
27
>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 :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform