Ruby 一个 ruby 小问题

chenge · 2013年02月01日 · 最后由 chenge 回复于 2013年02月01日 · 1514 次阅读
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 谢谢,是这样的。不是太熟悉。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号