A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

© fmi110 高级黑马   /  2015-8-21 11:41  /  291 人查看  /  3 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

a
  1. package fmi110;

  2. public class Test2 {
  3.         public static void main(String[] args) {
  4.                 tranFisrtLetter("hello");
  5.                
  6.         }
  7.         public static void tranFisrtLetter(String str){//将字符串首字母编程大写
  8.                 String firstLetter = str.substring(0,1);//获取首字母字符串
  9.                 System.out.println(firstLetter.toUpperCase() + str.substring(1));
  10.         }
  11. }
复制代码


3 个回复

倒序浏览
好,赞一个,顺便抢个板凳。。。
回复 使用道具 举报
楼主棒棒哒
回复 使用道具 举报

路漫漫  一起加油
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马