You are on page 1of 1

Strings in ruby Cheat Sheet

by Darek Ndza (nedzadarek) via cheatography.com/7647/cs/1149/

Strings in ruby Percentage notation

Name Example Interpolated? Name Example Interpolated

'' 'string' Q %Q[] yes

"" "string" yes q %q[] no

% notation %[string] only without or


with Q modyfier Here document

"Here <<HERE yes <<DELIMITER


document" some string
notation ' ' "string" can have

string #{interpolated_variable}
DELIMITER
HERE
with '-' ending delimiter can start with
spaces
<<-DELIMITER
text
_DELIMITER

Underscore used instead of space

By Darek Ndza (nedzadarek) Published 18th July, 2013. Sponsored by Readability-Score.com


cheatography.com/nedzadarek/ Last updated 18th July, 2013. Measure your website readability!
Page 1 of 1. https://readability-score.com

You might also like