标签:java string
将首字母大写
String a ="i am a boy"; String[] b =a.split("\\s+"); StringBuffer sb =new StringBuffer(); for (int i=0;i<b.length;i++){ sb.append(String.valueOf(b[i].charAt(0)).toUpperCase()+b[i].substring(1)+" "); } System.out.println(sb);
本文出自 “Java大白的战地” 博客,请务必保留此出处http://8023java.blog.51cto.com/10117207/1743821
标签:java string
原文地址:http://8023java.blog.51cto.com/10117207/1743821