Ruby on Rails Tuesday, February 5, 2019

> On Feb 5, 2019, at 3:34 AM, fugee ohu <fugee279@gmail.com> wrote:
>
> Does gsub have a global operator? How do I gsub in cases where there are multiple lines that need to be treated as a single string?

What is the difference between sub() and gsub()?

https://docs.ruby-lang.org/en/2.3.0/String.html#method-i-sub
https://docs.ruby-lang.org/en/2.3.0/String.html#method-i-gsub

What makes you think that gsub needs any special hint to treat a multi-line string as a source of multiple matches? Show your work.

Walter

>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c9dcb4ae-c3fb-4932-868b-4a2390295327%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/93730F34-0223-4BD5-BD5A-BB6CB2DD1C79%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment