ruby - What does the "s" do in this code? -



ruby - What does the "s" do in this code? -

the next code ruby implementation of caesar cypher:

def caeser(s,n)s.gsub(/./){|c|(c.ord+n).chr}end

it given solution problem here: http://www.sitepoint.com/ruby-golf/

what purpose of "s" @ end of caeser(s,n)s.

without "s", code doesn't work.

i think this:

def caeser(s,n) s.gsub(/./){|c|(c.ord+n).chr} end

ruby syntax

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -