$Str1 = "000001"; #$Index = index($Str1, [1-9]); $Index = @{[$Str1=~/(?<=0)./g]}+0; print "$Index\n";
Update: Doesn't work for "001001", for example...
In reply to Re: index using a range
by hbm
in thread index using a range
by romano
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |