[Java] 纯文本查看 复制代码 String str = "goOd gooD stUdy dAy dAy up";
//String str2 = str.replaceAll("\\b([A-Za-z])",(Character.toUpperCase(("$1".charAt(0))) + ""));
String str2 = str.replaceAll("\\b([A-Za-z])",(("$1").charAt[0] + "")); //这里出现异常
为什么会出现字符串越界异常?求大神解答 |