Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with Strings
Message
De
09/07/2003 07:20:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00808198
Message ID:
00808398
Vues:
14
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform