看板 [ Perl ]
討論串[問題] 陣列藉由索引取值
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者kornelius (c9s)時間15年前 (2010/03/14 12:24), 編輯資訊
0
0
0
內容預覽:
@array = 'a' .. 'z';. for($i=0,$item= $array[$i] ; $item = $array[$i]; $i++ ) {. $index = $i if $item =~ /[a-c]/;. }. 或是. $i=0;. map { $index = $i if

推噓0(0推 0噓 3→)留言3則,0人參與, 最新作者asdfgh00 (陸)時間15年前 (2010/03/04 02:17), 編輯資訊
0
0
0
內容預覽:
@array = (a, 1, 2, 3, b, 4, 5, 6);. 我希望能找出英文字母的索引位置. 然後印出之後的數字直到碰到下一個英文字母. foreach $item(@array){. if ($item =~ /[a-z]/){. $indeX = \$item; #取得索引. }.
首頁
上一頁
1
下一頁
尾頁