Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const numericCharAlphabetTuples = [
- ['0','a'],
- ['1','b'],
- ['2','c'],
- ['3','d'],
- ['4','e'],
- ['5','f'],
- ['6','g'],
- ['7','h'],
- ['8','i'],
- ['9','j'],
- ];
- function replaceNumbersInStringToAlphabet(string) {
- numericCharAlphabetTuples.forEach(tuple => {
- const numericChar = tuple[0];
- const alphabet = tuple[1];
- string = string.replace(numericChar, alphabet);
- });
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement