我不知道应该怎么将字符串的第一个字母转换为大写: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();这段代码好像没有用。请大虾指点,谢谢。
1 回答
MYYA
TA贡献1868条经验 获得超4个赞
StringBuilder rackingSystemSb = new StringBuilder( rackingSystem.toLowerCase()); rackingSystemSb.setCharAt(0, Character.toUpperCase(rackingSystemSb.charAt(0))); rackingSystem = rackingSystemSb.toString();
添加回答
举报
0/150
提交
取消