Java tutorial
//package com.java2s; public class Main { public static String simplifyName(String chordName) { String chord = chordName; chord = chord.toLowerCase(); // The first letter chord = Character.toString(chord.charAt(0)).toUpperCase() + chord.substring(1); int theChar = chordName.indexOf("/"); if (theChar > -1) { return chord.substring(0, theChar); } else { return chord; } } }