I am looking at converting the JS slugify function by diegok and he is using this JavaScript construct:
function turkish_map() {
return {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
};
}
It is a map of char to char translations. However, I don’t know which JS construct is this and how could it be rewritten in C# preferably without spending too much time on rewriting? (There’s more to it, this is just one of the functions).
Should I make an array, dictionary, something else?
The use it like:
Or you can save it into field and use it without creating it every time.