Convert char to lower case in J2ME without using the Character class

爱⌒轻易说出口 提交于 2019-12-01 11:26:10

Based on the toLowerCase() method from Character in JavaSE JDK:

char lowerChar = (char)CharacterData.of((int)upperChar).toLowerCase((int)upperChar);

You can read the source code from the JDK and understand what is really done here and apply the same thing with your own classes in JME.


Resources :

char toLowerCase(char c){
    if(c>=97 && c<=122)
        return (char) (c-32);
    else
        return c;
}

I just copied some of the stuff from Java SE 1.3 and included it in my J2ME app. Generally, it's a few methods and three big arrays from the Character class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!