Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7287

String Interpolation of Compound Statement

Newsgroups comp.lang.ruby
Date 2016-09-01 14:14 -0700
Message-ID <76ebf773-0dac-47e2-88e2-123260a6b309@googlegroups.com> (permalink)
Subject String Interpolation of Compound Statement
From BeeRich33 <beerich@gmail.com>

Show all headers | View raw


Hi folks.  I come from a language where we don’t have string interpolation.  Here’s what I would usually write:

@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?  I get hung up on the internal bit here:

@h[("s_fieldname_" + i.to_s)

I’m sure it’s out there.  I appreciate any input.

Cheers

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

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