What is the difference between ".scan" and ".split" in Ruby language? -


this question has answer here:

what difference between ".scan" , ".split" in ruby language?

can give me example?

i got confused it!

  • scan extracts substrings match given regex.
  • split extracts substrings not match given regex (and optionally, substrings match well).

Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -