Hacker News new | past | comments | ask | show | jobs | submit login

This is just string interpolation.



%q allows different delimiters to represent single quoted strings, which doesn't have string interpolation. For ex:

    $ ruby -e 'a=5; puts "[#{a}]"'
    [5]
    $ ruby -e 'a=5; puts %q/[#{a}]/'
    [#{a}]


%Q or just % does interpolation:

    $ ruby -e 'a=5; puts %Q/[#{a}]/'
    [5]
    $ ruby -e 'a=5; puts %/[#{a}]/'
    [5]




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: