dimanche 2 novembre 2014

Tring to find the index of the first number in a string using perl


Vote count:

0




I'm trying to find the index of the first occurrence of a number from 0-9.


Let's say that:


$myString = "ABDFSASF9fjdkasljfdkl1"


I want to find the position where 9 is.


I've tried this:


print index($myString,[0-9]);



asked 35 secs ago







Tring to find the index of the first number in a string using perl

Aucun commentaire:

Enregistrer un commentaire