+ 1

how to pass multiple arguments in "include?" method in ruby

#DATE IN MARCH 21(YEAR)Y/MONTH/D reg="21MAR03" invalid = false if reg.length != 7 invalid = false elsif reg[0..1].include?("21") && reg[2..4].include?("MAR") #HOW CAN I INCLUDE 20 IN THE CODE #LIKE include?("21","20") && reg[2..4].include?("MAR") #ITS NOT WORKING puts "valid" invalid = true end if invalid==false puts "invalid" end

3rd Mar 2021, 11:22 AM
MALLIKHARJUNA
MALLIKHARJUNA - avatar
2 odpowiedzi
+ 1
i would help you if i knew but do you know how to do the python for begniers search engine?
4th Mar 2021, 6:25 PM
☯【 x e n o z 】☯
☯【 x e n o z 】☯ - avatar
0
I have an idea how it works but don't know how to do exactly...
10th Mar 2021, 2:45 AM
MALLIKHARJUNA
MALLIKHARJUNA - avatar