Q:

Write a Ruby program to create a new array with the elements in reverse order from a given an array of integers length 3

0

Write a Ruby program to create a new array with the elements in reverse order from a given an array of integers length 3. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def check_string(str,chr)
   return str.tr(chr, '')
end
print check_string("JavaScript", 'a')
print "\n",check_string("Python", 'y')
print "\n",check_string("PHP", 'H') 

 

Output:
JvScript
Pthon
PP

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now