I need help to format the date in the code that is below. Should be the date shown on the form: 05. May 2014
. Please give me suggestions how to do it.
package person;
public class Person {
public static void main(String[] split) {
String text = "John.Davidson/05051988/Belgrade Michael.Barton/01011968/Krakov Ivan.Perkinson/23051986/Moscow";
String[] newText = text.split("[./ ]");
for(int i=0; i<newText.length; i+=4)
{
String name = newText[i].split(" ")[0];
String lastName = newText[i+1].split(" ")[0];
String dateOfBirth = newText[i+2].split(" ")[0];
String placeOfBirth = newText[i+3].split(" ")[0];
System.out.println("Name: " + name + ", last name: " + lastName + ", date of birth: " + dateOfBirth + ", place of birth: " + placeOfBirth);
}
}
}