Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #7301
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | "Robert L." <No_spamming@noWhere_7073.org> |
| Newsgroups | comp.lang.ruby |
| Subject | Re: String Interpolation of Compound Statement |
| Date | Thu, 24 Nov 2016 22:08:52 +0000 (UTC) |
| Organization | Aioe.org NNTP Server |
| Lines | 20 |
| Message-ID | <o17odj$1pab$1@gioia.aioe.org> (permalink) |
| References | <76ebf773-0dac-47e2-88e2-123260a6b309@googlegroups.com> |
| NNTP-Posting-Host | TmU4ZPVY73xAM4qgwqI3/Q.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | XanaNews/1.18.1.6 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.ruby:7301 |
Show key headers only | View raw
On 9/1/2016, BeeRich33 wrote:
> @f += "\t<label for=\"" + @h[("s_fieldname_" + i.to_s)].to_s +
> "\">" + @fieldname.capitalize + ":"
>
> Now I've been told there are less
> errors with string interpolation. How
> can I translate that?
@fieldname = "foo"
i = 2
@h = {"s_fieldname_2" => 1984}
"\t<label for=\"" + @h[("s_fieldname_" + i.to_s)].to_s +
"\">" + @fieldname.capitalize + ":"
==>"\t<label for=\"1984\">Foo:"
"\t<label for=\"#{@h[("s_fieldname_" + i.to_s)]}\">#{@fieldname.capitalize}:"
==>"\t<label for=\"1984\">Foo:"
Back to comp.lang.ruby | Previous | Next — Previous in thread | Find similar
String Interpolation of Compound Statement BeeRich33 <beerich@gmail.com> - 2016-09-01 14:14 -0700 Re: String Interpolation of Compound Statement "Robert L." <No_spamming@noWhere_7073.org> - 2016-11-24 22:08 +0000
csiph-web