Normalize a string by converting diacriticals to base characters, removing non-word characters, and converting to lower case. Non-strings return undefined.
Example
constvalue = normstr('Við skulum fara á fjörðurinn í kvöld.'); // value === 'viskulumfaraafjorurinnikvold'
normstr(value?): undefined | string
Parameters
Optionalvalue: string
The string to normalize.
Returns undefined | string
The normalized string or undefined if not a string.
Normalize a string by converting diacriticals to base characters, removing non-word characters, and converting to lower case. Non-strings return undefined.
Example