Ruby’s Percent Functions

by woody2shoes on April 13, 2010


Ruby uses special characters to define certain data types. If you wish to use these characters in your data types, you need to escape them or use percent functions.

Percent functions are much simpler.
Download 35.8 MB
Download (iphone & ipod) 14.7 MB

  • http://twitter.com/maxigs maxigs

    there is a even shorter version for strings, i.e. %{hello “world”} is equal to “hello “world”" or your %Q!hello “world”!

  • me

    As far as I know, %Q was taken from perl’s qw, which stands for quoted whitespace.

  • Anonymous

    The same, in text: http://jimhoskins.com/?p=8

  • http://twitter.com/maxigs maxigs

    there is a even shorter version for strings, i.e. %{hello “world”} is equal to “hello “world”" or your %Q!hello “world”!

  • me

    As far as I know, %Q was taken from perl's qw, which stands for quoted whitespace.

  • clbustos

    The same, in text: http://jimhoskins.com/?p=8

  • jsn

    @me: you’re wrong. %w was taken from perl’s qw; %Q was taken from perl’s qq.

  • jsn

    @me: you're wrong. %w was taken from perl's qw; %Q was taken from perl's qq.

  • http://www.clutterpad.com MK

    Great to see episodes coming out every week

  • http://www.clutterpad.com MK

    Great to see episodes coming out every week

Previous post:

Next post: