I have a project in android and I need a split line, actually the date here is the line I'm going to split:
String datetime = "01/03/2013 09:00";
and so I call them:
int year = splitDateTime(dateTime)[0];
public int[] splitDateTime(String datetime){ String date_time = datetime; String delimiter = "//:"; String[] sParts; int[] intParts; sParts = date_time.split(delimiter); intParts = new int[sParts.length]; for(int i =0; i < sParts.length ; i++) intParts[i] = Integer.parseInt(sParts[i]); return intParts; }
but he continues to give me a mistake, so I would be glad if you help me out of the guys. greetings
source share