Write a Ruby program to trim specific characters from a string.
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("JavaScript", 'JS')
Output:
JvScript Pthon avacript
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer