Skip to content

NormalizeString Function

Eugene Sergeev edited this page Jan 9, 2016 · 8 revisions

Syntax

string NormalizeString(value:string, [substitutions:string])

Description

Normalizes the first string, first by replacing the character substitutions specified in the second string and then removing all diacritics using the .NET string normalization function.

Remarks

If the optional second parameter (substitution string) specified, it is ':' and '|' separated in the form oldString1:newString1|oldString2:newString2… e.g. "Å:AA|Ä:AE|Ö:OE|å:aa|ä:ae|ö:oe|ß:ss|æ:ae"

Supported Version

2.14.611.0 and later

Examples

Replace some Nordic umlauts and strip accents from everything else:

NormalizeString([//Target/LastName], "Å:AA|Ä:AE|Ö:OE|å:aa|ä:ae|ö:oe|ß:ss|æ:ae") - Åhléns will become AAhlens, where Å will be replaces with AA and é will get its accept stripped and will become just e.

Replace Cyrillic chars with Latin ones and strip accents from everything else, e.g. Czech chars.

NormalizeString([//Target/LastName], "А:A|Б:B|В:V|Г:G|Д:D|Е:E|Ё:Yo|Ж:Zh|З:Z|И:I|Й:Y|К:K|Л:L|М:M|Н:N|О:O|П:P|Р:R|С:S|Т:T|У:U|Ф:F|Х:Kh|Ц:Ts|Ч:Ch|Ш:Sh|Щ:Sch|Ъ:|Ы:Y|Ь:|Э:E|Ю:Yu|Я:Ya|а:a|б:b|в:v|г:g|д:d|е:e|ё:yo|ж:zh|з:z|и:i|й:y|к:k|л:l|м:m|н:n|о:o|п:p|р:r|с:s|т:t|у:u|ф:f|х:kh|ц:ts|ч:ch|ш:sh|щ:sch|ъ:|ы:y|ь:|э:e|ю:yu|я:ya") - where Мао Цзэдун will become 'Mao Tszedun'

p.s. mind that all replacements are case-sensetive

Clone this wiki locally