Ruby's gsub can take a block: "10 comments".gsub(/ (.+)/) do |words| " <div class="superstyle">#{words.lstrip}</div>" end # "10 <div ...
確定! 回上一頁