mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
针对issue#I4X9TT修复
This commit is contained in:
parent
88a9fc4a37
commit
04ae795ce6
@ -97,7 +97,7 @@ public class NamingCase {
|
||||
// 后一个为大写,按照专有名词对待,如aBC -> a_BC
|
||||
} else {
|
||||
//前一个为大写
|
||||
if (null == nextChar || Character.isLowerCase(nextChar)) {
|
||||
if (null != nextChar && Character.isLowerCase(nextChar)) {
|
||||
// 普通首字母大写,如ABcc -> A_bcc
|
||||
sb.append(symbol);
|
||||
c = Character.toLowerCase(c);
|
||||
|
@ -422,6 +422,7 @@ public class StrUtilTest {
|
||||
.set("H2", "H2")
|
||||
.set("H#case", "H#case")
|
||||
.set("PNLabel", "PN_label")
|
||||
.set("DEPT_NAME","DEPT_NAME")
|
||||
.forEach((key, value) -> Assert.assertEquals(value, StrUtil.toUnderlineCase(key)));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user