Here you can find the source of getMonth(String date)
Parameter | Description |
---|---|
date | String in the format ..Month and day should be 2 digits |
public static String getMonth(String date)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w .jav a2 s . c o m * @param date String in the format ..Month and day should be 2 digits * @return String .. */ public static String getMonth(String date) { return date.substring(0, 2); } public static String substring(String input, int maxLength) { if (input == null) return null; else return (input.length()) <= maxLength ? input : input.substring(0, maxLength); } }