Write a Ruby program to check whether first and the last element are the same of an given array of integers
- برمجة
- برمجة روبي
- 2021-08-31
- mhanasmh00489829403
الأجوبة
def check_string(my_string, my_substr)
if my_string.include? my_substr
return "Substring present in the string."
else
return "Substring not present in the string."
end
end
print check_string("JavaScript","Script")
print "\n",check_string("JavaScript","Scriptt")
Output:
Substring present in the string. Substring not present in the string.
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
