How to do this
- From: Damjan Rems <d_rems@xxxxxxxxx>
- Date: Tue, 12 Oct 2010 08:02:59 -0500
I don't know how to explain so I will just code:
template = 'some text #{variable}' # single quotes for reason
variable = 'filled'
res = some_method(template)
Here, res should have value 'some text filled'.
Is there an easy way doing this in ruby. Hard way is of course parsing
and inserting text with my own method.
by
TheR
--
Posted via http://www.ruby-forum.com/.
.
- Follow-Ups:
- Re: How to do this
- From: Stefano Crocco
- Re: How to do this
- From: Robert Klemme
- Re: How to do this
- From: Josh Cheek
- Re: How to do this
- Prev by Date: Re: more idiomatic way to avoid errors when calling method on variable that may be nil?
- Next by Date: Re: Using DRB as a secure interface
- Previous by thread: Using DRB as a secure interface
- Next by thread: Re: How to do this
- Index(es):
Relevant Pages
|