Ruby 一个 ruby 小问题

chenge · February 01, 2013 · Last by chenge replied at February 01, 2013 · 1527 hits
class String
def to_x
    gsub /[^\w\s]/, ''
end 
end

 p 'ab#'.to_x

? gsub 前不需要 self?

You come from python?

Self is the default

#1 楼 @blacktulip 谢谢,是这样的。不是太熟悉。

You need to Sign in before reply, if you don't have an account, please Sign up first.