j
k
j a
j l
program_num = program.match(/(.*)(\-\d{1,}$)/) if program_num != nil program = program_num.not_nil![1] end
program_num = program.match(/(.*)(\-\d{1,}$)/)
if program_num != nil
program = program_num.not_nil![1]
end
The typical way is
if program =~ /(.*)-\d+$/ program = $1 end
Thanks, Fengguang
Back to the thread
Back to the list