And English is a Work in Progress ⌛
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getInitials(str: string, glue = true): string | string[] { | |
const initials = str.replace(/[^a-zA-Z- ]/g, '').match(/\b\w/g); | |
if (glue) { | |
return initials.join(''); | |
} | |
return initials; | |
} |
OlderNewer