[ create a new paste ] login | about

Link: http://codepad.org/KZ5X6vIV    [ raw code | output | fork ]

joshua_cheek - Ruby, pasted on Oct 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
my_array = [1,2,3,4]

puts "\nputs my_array"
puts my_array

puts "\nputs my_array.to_s"
puts my_array.to_s

puts "\nprint my_array"
print my_array

puts "\n\nputs my_array.inspect"
puts my_array.inspect

puts "\np my_array"
p my_array


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

puts my_array
1
2
3
4

puts my_array.to_s
1234

print my_array
1234

puts my_array.inspect
[1, 2, 3, 4]

p my_array
[1, 2, 3, 4]


Create a new paste based on this one


Comments: