v1
2/23/2023 by nikkypizza -00
Setup HTML - click to add setup HTML
Setup JS - click to add setup JavaScript
delete caserun single casemove downdrag and drop case


ready



correct = s => s.replace(/0/g,'O').replace(/1/g,'I').replace(/5/g,'S')

correct("L0ND0N")
correct("DUBL1N")
correct("51NGAP0RE")
correct("BUDAPE5T")
correct("PAR15")
delete caserun single casemove upmove downdrag and drop case


ready



function correct(s){
	s = s.split('');
  for (var i = 0; i < s.length; i++) {
    if (s[i] === '5') s[i] = 'S';
    else if (s[i] === '0') s[i] = 'O';
    else if (s[i] === '1') s[i] = 'I';
    }
  return s.join('');
}

correct("L0ND0N")
correct("DUBL1N")
correct("51NGAP0RE")
correct("BUDAPE5T")
correct("PAR15")
delete caserun single casemove upmove downdrag and drop case


ready



function correct(string){
  return string.replaceAll('0', 'O').replaceAll('1', 'I').replaceAll('5', 'S');
}

correct("L0ND0N")
correct("DUBL1N")
correct("51NGAP0RE")
correct("BUDAPE5T")
correct("PAR15")
delete caserun single casemove upmove downdrag and drop case


ready



function correct(string){
  const map = {5:'S',0:'O',1:'I'};
  return string.replace(/[501]/g, (it) => map[it]);
}

correct("L0ND0N")
correct("DUBL1N")
correct("51NGAP0RE")
correct("BUDAPE5T")
correct("PAR15")
delete caserun single casemove updrag and drop case


ready



function correct(string){
  const map = {5:'S',0:'O',1:'I'};
  const ref = '501';
  return string.split('').map(it => ref.includes(it) ? map[it] : it).join('')
}

correct("L0ND0N")
correct("DUBL1N")
correct("51NGAP0RE")
correct("BUDAPE5T")
correct("PAR15")
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN