Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with Strings
Message
From
09/07/2003 07:20:10
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00808198
Message ID:
00808398
Views:
15
Hi Brenda

>How can I take a string and replace certain constants with constants of a largers, or smaller size? Say I want to replace all ':' with ': '. There are several different constants and each constant could have many different occurances. I am using VFP 6.0.

As others have said, STRTRAN() allows to replace specific characters (or groups of characters) with another character, or group of characters. Even in VFP 6, you can specify the starting occurrence (i.e. first, second etc) and the number of replacements - though you do not get the additional control over case sensitivity that VFP 7.0 introduced.

However, STRTRAN is designed to replace datsa, if you want merely want to insert one or more characters, then you can use the AT() and STUFF() functions to determine the location in a string and insert the new characters directly.
----
Regards
Andy Kramek
Previous
Reply
Map
View

Click here to load this message in the networking platform