Thus, “localization” will likely be spelt as “l10n”, and “internationalization» will likely be spelt as “i18n”. Phrases with size lower than 10 ought to print the identical.
inputCopy
4
phrase
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
outputCopy
phrase
l10n
i18n
p43s
Resolution:
const strAbbr = str =>{
let startWord = str[0];
let endWord = str[str.length – 1];
if(str.size<=10){
return str;
}
else{
return `${startWord}${str.length-2}${endWord}`;
}
}
console.log(strAbbr(‘iamstringo’))
console.log(strAbbr(‘iaminlengthmorethanten’))
console.log(strAbbr(‘lesslength’))
OUTPUT