Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Let's see
Message
De
30/03/2021 15:10:43
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
29/03/2021 17:29:08
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01679334
Message ID:
01679367
Vues:
84
Apart from prior chrtran() and strtran() offerings... you might avoid the duplicate substr():
lcString="ABC,DEF,GHI,JKL"
lcString2=""
x=0
do while x<len(m.lcString)
  x=m.x+1
lcString3=SUBSTR(m.lcString,m.x,1)
  IF m.lcString3<>","
    lcString2=m.lcString2+m.lcString3
  ENDIF
enddo X
?m.lcString2
For enjoyers of left field:
lcString="ABC,DEF,GHI,JKL"
lcString2=""
licount=getwordcount(m.lcString,",")
for x=1 to m.liCount
   lcString2=m.lcString2+getwordnum(m.lcString,m.x,",")
endfor
?m.lcString2
And then there's always strextract()...
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform