# Nuby: %w to understand quotes

**URL:** <https://www.ruby-forum.com/t/nuby-w-to-understand-quotes/94133>\
**Category:** Ruby\
**Created:** [April 22, 2006, 7:51am UTC](https://www.ruby-forum.com/t/nuby-w-to-understand-quotes/94133 "2006-04-22T07:51:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [April 22, 2006, 7:51am UTC](https://www.ruby-forum.com/t/nuby-w-to-understand-quotes/94133/1 "2006-04-22T07:51:52Z")

</div>

Hi All,

irb(main):007:0\> %w{this is a test}  
=\> [“this”, “is”, “a”, “test”]

fine.

irb(main):008:0\> %w{“this is” “a test”}  
=\> ["“this”, “is”", ““a”, “test””]

i want

[“this is”,“a test”]

Is there a ruby notation like %w that understand quotes?

thank you and kind regards -botp

---

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [April 22, 2006, 8:04am UTC](https://www.ruby-forum.com/t/nuby-w-to-understand-quotes/94133/2 "2006-04-22T08:04:05Z")

</div>

Try this:

%w{this\ is a\ test}

- Jake McArthur

---

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [April 22, 2006, 8:07am UTC](https://www.ruby-forum.com/t/nuby-w-to-understand-quotes/94133/3 "2006-04-22T08:07:06Z")

</div>

Hi,

In message “Re: nuby: %w to understand quotes”  
on Sat, 22 Apr 2006 14:48:46 +0900, Peña, Botp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
writes:

|irb(main):008:0\> %w{“this is” “a test”}  
|=\> [“"this”, “is"”, “"a”, “test"”]  
|  
|i want  
|  
|[“this is”,“a test”]  
|  
|Is there a ruby notation like %w that understand quotes?

%w understands backslash escape

|irb(main):001:0\> %w{this\ is a\ test}  
|=\> [“this is”,“a test”]

```
						matz.

```
