若依 4.0

This commit is contained in:
RuoYi
2019-08-08 08:53:12 +08:00
parent 5f05734e46
commit 1c3541cc05
63 changed files with 4410 additions and 1291 deletions

View File

@ -362,4 +362,37 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
return result.toString();
}
/**
* 驼峰式命名法 例如user_name->userName
*/
public static String toCamelCase(String s)
{
if (s == null)
{
return null;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c == SEPARATOR)
{
upperCase = true;
}
else if (upperCase)
{
sb.append(Character.toUpperCase(c));
upperCase = false;
}
else
{
sb.append(c);
}
}
return sb.toString();
}
}