Java tutorial
//package com.java2s; public class Main { public static String capitalizeFirstChar(String name) { if (name == null || name.length() == 0) { return name; } if (name.startsWith("_")) { return capitalizeFirstChar(name.substring(1)); } char chars[] = name.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); } }