30
rackingSystem.toLowerCase(); // has capitals in every word, so first convert all to lower case
StringBuilder rackingSystemSb = new StringBuilder();
rackingSystemSb.append(rackingSystem);
rackingSystemSb.setCharAt(0, Character.toUpperCase(rackingSystemSb.charAt(0)));
rackingSystem = rackingSystemSb.toString();
這似乎並沒有工作..
有什麼建議?
'公共靜態字符串資本(String s)將{ \t \t如果(S == NULL)回報空值;如果(s.length()== 1){ \t \t \t return s.toUpperCase(); \t \t} \t \t如果(s.length()> 1){ \t \t \t返回s.substring(0,1).toUpperCase()+ s.substring(1); \t \t} \t \t return「」; \t}' – Roel 2015-05-04 12:16:21