Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find number within string
Message
De
06/07/1999 11:13:34
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00237774
Message ID:
00237779
Vues:
12
>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"
>
>any help appreciated:)

I would probably consider writing a function that I could pass the string in question to. I would then determine the length of the string and traverse through it one char at a time. In finding the first char that was a number, I would store it and keep moving until I ran out of numeric chars. Convert the chars found to a number and return it to the calling routine...

HTH
Michael
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform