I would like to convert a string to camelcase but avoid a word in that string.
public class camelTest
{
public static void main(String []args)
{
String test = "St. KiTTs aND Nevis";
System.out.println(toCamelCase(test));
}
public static String toCamelCase(String test1)
{
String[] split = test1.split(" ");
String ret = "";
for (int i=0;i<split.length;i++)
{
ret=ret+split[i].substring(0,1).toUpperCase()+split[i].substring(1).toLowerCase()+" ";
}
return ret.trim();}
}
The code above has the output of: St. Kitts And Nevis
I would like it instead to say: St. Kitts and Nevis