Write a Ruby program to get a substring from a specified position to the last char of a given string.
def check_string(str, n) str = str[n...-1] return str end print check_string("JavaScript", 5) print "\n",check_string("Python",3) print "\n",check_string("Ruby", 2) print "\n",check_string("PHP", 0)
Output:
crip ho b PH
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