Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find number within string
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00237774
Message ID:
00237802
Vues:
9
Hi John,

>Is there a way to find a number within a string? Here's the twist, the number could be anywhere in the string, and I want to find any number...like this "#70 blue" or "70 blue" or "blue 70"

My suggestion is similar to George's, except that you don't need FoxTool.Fll:

ChrTran(lcString,ChrTran(lcString,"0123456789",""),"")

The inner chrtran determines all characters that are not digits and are contained in the string. The outer ChrTran removes all of these characters. What remains are the digits. It's the same a StrFilter().

Christof
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform