Here you can find the source of camelCase(String s)
public static byte[] camelCase(String s)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009 MATERNA Information & Communications. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html. For further * project-related information visit http://www.ws4d.org. The most recent * version of the JMEDS framework can be obtained from * http://sourceforge.net/projects/ws4d-javame. ******************************************************************************/ public class Main { public static byte[] camelCase(String s) { byte[] b = s.getBytes(); boolean camel = true; for (int i = 0; i < b.length; i++) { if (b[i] >= 97 && b[i] <= 122 && camel) { b[i] = (byte) (b[i] - 32); camel = false;//w w w .ja v a 2s . c o m } if (b[i] == 32 && !camel) { camel = true; } if (b[i] == 45 && !camel) { camel = true; } } return b; } }