看板 Perl 關於我們 聯絡資訊
$i=1; $test = "TEST!TEST!TEST!"; $test =~ s/!/"!".$i++/ge; print $test; <>; #這樣應該對了,剛剛忘了驚嘆號@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.124.1.64
Austin9:謝謝imce大大,果然可以用reg這種快速的累加方法,我一直 10/24 16:14
Austin9:卡在/"!".$i++/這個地方,弄出怎麼累加!!謝謝。 10/24 16:15
Austin9: 弄不出怎麼累加!!謝謝。 10/24 16:16