Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

best ruby cheat sheet

"Hello".length # 5
"Hello".reverse # “olleH”
"Hello".upcase # “HELLO”
"Hello".downcase # “hello”
"hello".capitalize # “Hello”
"Hello".include? "i" # equals to false because there is no i in Hello
"Hello".gsub!(/e/, "o") # Hollo
"1".to_i # transform string to integer –– 1
"test".to_sym # converts to :test
"test".intern # :test
:test.to_s # converts to "test"
Source by github.com #
 
PREVIOUS NEXT
Tagged: #ruby #cheat #sheet
ADD COMMENT
Topic
Name
2+1 =