/**
* 字符串首字母大写
* @param entryStr
* @return
* @throws Exception
*//*
private static String changeFirstStrUpcase(String entryStr) throws Exception {
byte[] items = entryStr.getBytes();
items[0] = (byte) ((char) items[0] - 'a' + 'A');
return new String(items);
}
* 字符串首字母大写
* @param entryStr
* @return
* @throws Exception
*//*
private static String changeFirstStrUpcase(String entryStr) throws Exception {
byte[] items = entryStr.getBytes();
items[0] = (byte) ((char) items[0] - 'a' + 'A');
return new String(items);
}
本文介绍了一种简单的方法来实现字符串首字母的大写转换。通过直接操作字符串的字节来改变首字母的大小写,这种方法高效且易于理解。
4740

被折叠的 条评论
为什么被折叠?



