Write a Ruby program to check whether a string starts with an other string.
def check_string(my_string, substr) return my_string.start_with?(substr) end print check_string("JavaScript", "Java") print "\n",check_string("Python", "PHP")
Output:
true false
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