Write a Ruby program to remove the first and last two characters from a specified string.
def check_string(str) str = str[2...-2] return str end print check_string("JavaScript") print "\n",check_string("Python") print "\n",check_string("Ruby") print "\n",check_string("PHP")
Output:
vaScri th
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