Java String Case Insert invertDate(String sDate)

Here you can find the source of invertDate(String sDate)

Description

invert Date

License

Open Source License

Declaration

public static String invertDate(String sDate) 

Method Source Code

//package com.java2s;

public class Main {
    public static String invertDate(String sDate) {
        String retVal = sDate;//w  ww .j a  v  a 2 s .c  o m
        if (sDate != null) {
            if (sDate.length() == 6) {
                retVal = sDate.substring(4, 6) + sDate.substring(2, 4) + sDate.substring(0, 2);
            } else {
                retVal = sDate.substring(4, 8) + sDate.substring(2, 4) + sDate.substring(0, 2);
            }
        }
        return retVal;
    }
}

Related

  1. invert(final String s)
  2. invert(String s)
  3. invertCase(String line)
  4. invertCase(String str)
  5. inverter(String str)
  6. inverter(String string)
  7. inverterString(String palavra)
  8. invertHostName(String hostNameIn)