Thanks in advance to anyone who can think of a more efficient or a better way to do what my Javascript code below does:
var availableCharacters=Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
for (counter=0; counter<availableCharacters.length; counter++){
if(availableCharacters[counter]=="i"||
availableCharacters[counter]=="l"||
availableCharacters[counter]=="I"||
availableCharacters[counter]=="L"||
availableCharacters[counter]=="1"||
availableCharacters[counter]=="0"||
availableCharacters[counter]=="O"){
availableCharacters.splice(counter, 1);
}
}
What I'm trying to do is run through an array and remove any elements in that array that are "i", "l", "I", "L", "1", "0" or "O". Whilst this does work it seems like it might be slow and a bit cumbersome. If there is a better way? If not then not a problem, but most of the time when I do something that doesnt seem right to me, it's not! So I thought I'd ask S.O.
Thanks :)