Write a Ruby program to check whether a string starts with "if"
Ruby Code:
def start_if(str) return str[0, 2] == "if"; end print start_if("ifelse"),"\n" print start_if("endif"),"\n"
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.
Ruby Code: