rubikitch #540(2007/07/11 07:34 GMT) [ Ruby ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10
def remove_comment(str) str.gsub(%r!/\*(.+?)(\*/|$)!, "") end remove_comment('AAA') # => "AAA" remove_comment('AAA/*BBB*/') # => "AAA" remove_comment('AAA/*BBB') # => "AAA" remove_comment('AAA/*BBB*/CCC') # => "AAACCC" remove_comment('AAA/*BBB/*CCC*/DDD*/EEE') # => "AAADDD*/EEE" remove_comment('AAA/a//*BB*B**/CCC') # => "AAA/a/CCC"
Rating0/0=0.00-0+
[ reply ]
rubikitch
#540()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]