# Re: Trouble parsing against a hash

**URL:** <https://www.ruby-forum.com/t/re-trouble-parsing-against-a-hash/64994>\
**Category:** Ruby\
**Created:** [August 15, 2006, 4:29pm UTC](https://www.ruby-forum.com/t/re-trouble-parsing-against-a-hash/64994 "2006-08-15T16:29:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CameronS\_Gemma\_SUK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Post date:** [August 15, 2006, 4:29pm UTC](https://www.ruby-forum.com/t/re-trouble-parsing-against-a-hash/64994/1 "2006-08-15T16:29:03Z")

</div>

> Right. But never use:
> 
> “#{var}”

I thought #{var} was used within quotes to get the value as otherwise  
you just get var…

var = “Hello Ruby T. World”  
“I just wanted to say #{var}” -\> I just wanted to say Hello Ruby T.  
World  
“I just wanted to say var” -\> I just wanted to say var

or am I missing the point?

To me it’s easier to do the above and much cleaner than the following:

print "I just wanted to say " + var + “, love the slippers!”

Or am I just showing my ant roots again…? ${var}

Gem

---

<div class="post-metadata">

**Author:** ![CameronS\_Gemma\_SUK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Post date:** [August 15, 2006, 4:38pm UTC](https://www.ruby-forum.com/t/re-trouble-parsing-against-a-hash/64994/2 "2006-08-15T16:38:38Z")

</div>

On Aug 15, 2006, at 9:27 AM, Cameron, Gemma (UK) wrote:

> > Right. But never use:
> > 
> > “#{var}”
> 
> I thought #{var} was used within quotes to get the value as  
> otherwise you just get var…

Correct.

> var = “Hello Ruby T. World”  
> “I just wanted to say #{var}” -\> I just wanted to say Hello Ruby  
> Talk World  
> “I just wanted to say var” -\> I just wanted to say var
> 
> or am I missing the point?

Nope you have it.

What I meant to say in my other message was if it is the _only_ thing  
in the String, it’s pointless.

James Edward G. II
