ruby rot13加密

class String
  def rot13
    self.tr "A-Za-z", "N-ZA-Mn-za-m"
  end
end

#用法:
#str="abc"
#print str.rot13

编程技巧