Re: nuby: %w to understand quotes


#1

David C. [mailto:removed_email_address@domain.invalid] :

But why? %w is intended as a shortcut when everthing is a

single word. For

anything else, use quotes.

yes, you’re right. maybe, i was looking for a shortcut on word or
“phrases of words” :slight_smile:

kind regards -botp


#2

On Mon, 2006-04-24 at 10:03 +0900, Peña wrote:

David C. [mailto:removed_email_address@domain.invalid] :

But why? %w is intended as a shortcut when everthing is a

single word. For

anything else, use quotes.

yes, you’re right. maybe, i was looking for a shortcut on word or “phrases of words” :slight_smile:

Perhaps you are looking for shellwords?

require ‘shellwords’
Shellwords.shellwords %{this is “just a” test}

=> [“this”, “is”, “just a”, “test”]