Write a Ruby program to remove a substring from a specified string.
def check_string(my_string, substr) my_string.slice! substr return my_string end print check_string("JavaScript", "Script") print "\n",check_string("HTMLCSS", "HTML")
Output:
Java CSS
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