Here you can find the source of displayMonthlyPeriod(String week)
public static String displayMonthlyPeriod(String week)
//package com.java2s; public class Main { public static String displayMonthlyPeriod(String week) { String[] monthNames = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; StringBuffer displayPeriod = new StringBuffer(); displayPeriod.append(monthNames[Integer.parseInt(week.substring(0, week.indexOf('-')))] + " "); displayPeriod.append(week.substring(week.lastIndexOf('-') + 1)); return displayPeriod.toString(); }//from w w w . j a v a 2 s . co m }