Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
X# examples - Reverse string
Message
De
23/10/2019 21:27:37
 
 
À
23/10/2019 02:51:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01671628
Message ID:
01671656
Vues:
52
Hi VFPers,

How about we want to reverse our string around a marker, e.g. "A, B, C" -> "C, B, A"?
FUNCTION Reverse(cStr AS STRING, cMarker AS STRING) AS STRING
  VAR aTemp = cStr.Split(<STRING>{cMarker})
  LOCAL cReverse = "", cDel = "" AS STRING
  FOR VAR i = aTemp.Length - 1 DOWNTO 0
    cReverse += cDel + aTemp[i]
    cDel = cMarker
  ENDFOR
  RETURN cReverse
ENDFUNC
Johan Nel
George, South Africa
Friend of XSharp (FOX) member
E-mail : johan(dot)nel(at)xsinet(dot)co(dot)za
Web site : https://xsharp.info
X# runtime : https://github.com/X-Sharp/XSharpPublic
Radio talk : https://blog.aksel.com/2019/07/why-xsharp-might-be-tool-foxpro.html
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform