JAVA中怎么互相转换字母的大小写?
具体怎么用  高手说说

解决方案 »

  1.   

    直接调用java.lang.Character类的两个静态函数即可:static char toLowerCase(char ch) 
    Converts the character argument to lowercase using case mapping information from the UnicodeData file. static char toUpperCase(char ch) 
    Converts the character argument to uppercase using case mapping information from the UnicodeData file. 
      

  2.   

    如果是单个字符,用2楼的方法;
    如果是字符串,调用String对象的下面两个方法:
    String toLowerCase() 
              Converts all of the characters in this String to lower case using the rules of the default locale. String toUpperCase() 
              Converts all of the characters in this String to upper case using the rules of the default locale.
      

  3.   

    哇,原来有现成的函数,原本还想建议他直接计算ASCII码呢.
      

  4.   

    不用计算ASCII码那么麻烦吧,用2楼和4楼的方法就可以了