package stringTest;
public class HumpStr {
public static void main(String[] arags){
String str1 = "ABCD_EFGH";
System.out.println(toLower(str1));
System.out.println(toHumpStr(toLower(str1),"_"));
}
public static String toLower(String str){
return str.toLowerCase();
}
public static String toUpper(String str){
return str.toUpperCase();
}
public static String toHumpStr(String str,String flag){
String[] strs = str.split(flag);
StringBuilder sb = new StringBuilder();
sb.append(strs[0]);
for(int i=1; i<strs.length; i++){
char[] temp = strs[i].toCharArray();
temp[0] -= 32;
sb.append(String.valueOf(temp));
}
return sb.toString();
}
}
最后
以上就是自觉画笔最近收集整理的关于驼峰字符串的全部内容,更多相关驼峰字符串内容请搜索靠谱客的其他文章。
发表评论 取消回复