Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locating and replacing a charcter in a field
Message
De
28/12/1999 15:23:49
 
 
À
28/12/1999 14:57:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00309380
Message ID:
00309430
Vues:
25
>Actually, I believe that Dave Frankenbach found this not to be the case recently; the time on STRTRAN() was ~O(n) whereas CHRTRAN() ~O(n^2) on performing substitutions.

Hmm, well in the context of Sean's example:
clear

s = seconds()
for x = 1 to 1000000
	=strtran('smith, charles', ',', '')
endfor
?seconds() - s

s = seconds()
for x = 1 to 1000000
	=chrtran('smith, charles', ',', '')
endfor
?seconds() - s
I always get nearly a third the time. But this is with one occurence and one character, so you are probably correct (whats new? :-), but in Seans question, CHRTran() would be a better faster choice.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform