Show Menu
Cheatography

Strings in ruby Cheat Sheet by

Strings in ruby

Strings in ruby

Name
Example
Interp­olated?
' '
'string'
" "
"­str­ing­"
yes
% notation
%[string]
only without or with Q modyfier
"Here docume­nt" notation
<<HERE
yes
 
string
 
HERE
 

Percentage notation

Name
Example
Interp­olated
Q
%Q[]
yes
q
%q[]
no
 

Here document

<<D­ELI­MITER
some string
' ' "­str­ing­" can have
#{inte­rpo­lat­ed_­var­iable}
DELIMITER
with '-' ending delimiter can start with spaces
<<-­DEL­IMITER
text
_DELIMITER
Underscore used instead of space
           
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          vim-rails Cheat Sheet
            Ruby Cheat Sheet by CodeConquest