把字符串第一个字母大写

把字符串第一个字母大写
1  private   static  String getMethodName(String fildeName){
2  byte [] items  =  fildeName.getBytes();
3  items[ 0 =  ( byte )(( char )items[ 0 ] - ' a ' + ' A ' );;
4  return   new  String(items);
5  }


效率是最高的.

你可能感兴趣的:(把字符串第一个字母大写)