# Concat is driving me crazy

**URL:** <https://www.ruby-forum.com/t/concat-is-driving-me-crazy/75128>\
**Category:** Ruby\
**Created:** [November 7, 2006, 5:56pm UTC](https://www.ruby-forum.com/t/concat-is-driving-me-crazy/75128 "2006-11-07T17:56:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jay](https://www.ruby-forum.com/u/jay)\
**Post date:** [November 7, 2006, 5:56pm UTC](https://www.ruby-forum.com/t/concat-is-driving-me-crazy/75128/1 "2006-11-07T17:56:36Z")

</div>

This is driving me crazy. For some reason

product.title = “this is”  
item.title = product.title.to\_s \<\< ’ my string’

yields “this is my string”

but

product.title = “this is”  
item.title = 'my string ’ \<\< product.title.to\_s

will only yield “this is” without adding 'my string ’ at the beginning.  
I feel like there must be something incredibly simple I’m missing.  
Advice would be much appreciated.

---

<div class="post-metadata">

**Author:** ![jay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jay](https://www.ruby-forum.com/u/jay)\
**Post date:** [November 7, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/concat-is-driving-me-crazy/75128/2 "2006-11-07T18:16:39Z")

</div>

I found the answer: I’m a moron. Please disregard.

---

<div class="post-metadata">

**Author:** ![jay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jay](https://www.ruby-forum.com/u/jay)\
**Post date:** [November 7, 2006, 6:18pm UTC](https://www.ruby-forum.com/t/concat-is-driving-me-crazy/75128/3 "2006-11-07T18:18:41Z")

</div>

On 11/7/06, Jay [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> item.title = 'my string ’ \<\< product.title.to\_s
> 
> will only yield “this is” without adding 'my string ’ at the beginning.  
> I feel like there must be something incredibly simple I’m missing.  
> Advice would be much appreciated.

What type of objects are _prodcut_ and _title_? Most likely the  
unexpected behavior is happening in these objects.

If you could post some more code that is runnable by itself and  
demonstrates the unexpected behavior, then an answer might be quicker  
in the coming.

Blessings,  
TwP
