@ Size ( 2 ) @ NonNull static String [ ] separateDateStringParts ( @ NonNull @ Size ( max = 4 ) String expiryInput ) { String [ ] parts = new String [ 2 ] ; if ( expiryInput . length ( ) >= 2 ) { parts [ 0 ] = expiryInput . substring ( 0 , 2 ) ; parts [ 1 ] = expiryInput . substring ( 2 ) ; } else { parts [ 0 ] = expiryInput ; parts [ 1 ] = "" ; } return parts ; }
Separates raw string input of the format MMYY into a month group and a year group . Either or both of these may be incomplete . This method does not check to see if the input is valid .