Java tutorial
//package com.java2s; import java.util.Locale; public class Main { /** * Capitalizes the first letter of the string and converts '_' to ' '. * * That is, where the name is "field_name", this will return "Field name". */ private static String formatFieldName(String name) { return name.substring(0, 1).toUpperCase(Locale.US) + name.substring(1).replace('_', ' ').trim(); } }