Forum: Ruby want to create a file with variable name

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Srikanth J. (Guest)
on 2008-12-12 15:13
hi i want to create a file name, with that variable name..

for example..

created file name is a.txt
i want the file as 10.txt

can any one help??
John S. (Guest)
on 2008-12-12 15:27
(Received via mailing list)

f ="#{a}.txt",'a')

Regards, John.
Srikanth J. (Guest)
on 2008-12-12 15:29
John Slobbe wrote:
> Try:
> f ="#{a}.txt",'a')
> Regards, John.

Thank You so much john..
its working.
This topic is locked and can not be replied to.