Here you can find the source of cameliza(String str)
public static String cameliza(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String cameliza(String str) { char[] strCharArray = str.toCharArray(); int nroEspacos = conta(' ', str); char[] strCamelizada = new char[strCharArray.length - nroEspacos]; for (int i = 0, j = 0; i < strCharArray.length; i++) { if (strCharArray[i] != ' ') { strCamelizada[j++] = minuscula(strCharArray[i]); } else { strCamelizada[j++] = maiuscula(strCharArray[++i]); }/* w ww .ja v a2 s. c o m*/ } return new String(strCamelizada); } public static int conta(char c, String str) { char[] strCharArray = str.toCharArray(); int ocorrencias = 0; for (int i = 0; i < strCharArray.length; i++) { if (strCharArray[i] == c) { ocorrencias++; } } return ocorrencias; } public static char minuscula(char c) { if (c >= 65 && c <= 90) { return (char) (c + 32); } else { return c; } } public static char maiuscula(char c) { if (c >= 97 && c <= 122) { return (char) (c - 32); } else { return c; } } }