Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement