We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
switch(true){
case regex1.test(s):
letter="A";
break;
case regex2.test(s):
letter="B";
break;
case regex3.test(s):
letter="C";
break;
case regex4.test(s):
letter="D";
break;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Conditional Statements: Switch
You are viewing a single comment's thread. Return to all comments →