Java tutorial
//package com.java2s; public class Main { public static String addSetString(String fieldName) { if (fieldName.startsWith("is")) { return fieldName.replace("is", "set"); } StringBuffer sb = new StringBuffer(); sb.append("set"); sb.append(fieldName.substring(0, 1).toUpperCase()); sb.append(fieldName.substring(1)); return sb.toString(); } }