Skip to content

Instantly share code, notes, and snippets.

@chadwickdonald
Created June 26, 2012 17:56
Show Gist options
  • Select an option

  • Save chadwickdonald/2997485 to your computer and use it in GitHub Desktop.

Select an option

Save chadwickdonald/2997485 to your computer and use it in GitHub Desktop.
assess
def new_cat(string1, string2)
new_string = string1 + string2
end
new_cat("Chad", "Bidwell")
def sum(numbers)
sum = 0
numbers.each {|num| sum += num}
sum
end
for ["ruby", "is", "the", "best", "programming" ,"language", "ever"]
index 3 = "best"
"ruby" is at index 0
length = 7
class String
def fun_string!
string_ar = self.split("")
i = 1
new_string =""
string_ar.each do |letter|
if i%2 == 0
new_string << letter.upcase
end
i++
end
self = new_string.reverse
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment