On Oct 9, 7:53 am, David Trasbo <[EMAIL PROTECTED]>
wrote:
> David Trasbo wrote:
> I've been looking through the StringScanner documentation
> (http://www.ruby-doc.org/core/classes/StringScanner.html), but it
> doesn't seem to cover the topic of replacing matches instead of just
> extracting it, if you know what I mean.
>
> How can I replace a {some_partial foo:bar} match with a partial
> rendering?

the string scanner will tell you its position. Keep track of the
relevant positions and then use String's usual methods to replace
content between 2 positions.

Fred
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to