var appchar; if (lower in map) appchar = map[lower]; else appchar = char; if (upper) appchar = appchar.toUpperCase();