Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * MMdd -> MM-dd
     * 
     * @param MMdd
     * @return
     */
    public static String formatMMddDash(String MMdd) {
        if (null != MMdd && MMdd.length() == 4) {
            StringBuffer sb = new StringBuffer(MMdd);
            sb.insert(2, "-");
            return sb.toString();

        }
        return MMdd;
    }
}