Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var replacementMap = {0: 'O',
- 1: 'I',
- 5: 'S'},
- string = '5051, L0H';
- for (var digit in replacementMap) {
- string = string.replace(new RegExp(String(digit), 'gi'), replacementMap[digit]);
- }
Advertisement
Add Comment
Please, Sign In to add comment