If you want to do that: just make sure the input data is in all lowercase, and use lowercase cases...
switch ("UPPER".toLowerCase()) {
case "upper" :
....
Localization issues
Also, the ages old issue of localization strikes again, and plagues this thing too... For example, in the Turkish Locale, the uppercase counterpart of i
is not I
, but ?
... And in return, the I
is not transformed to i
, but a "dotless i": ?
. Don't underestimate this, it can be a deadly mistake...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…