import javax.swing.*;
class Month
{
public static void main(String[]args)
{
String value=JOptionPane.showInputDialog(null,"Enter Month Day and Year");
if(value.length()==10)
{
char Month=value.charAt(0)+value.charAt(1);
char Day=value.charAt(3)+value.charAt(4);
char Year=value.charAt(6)+value.charAt(7)+value.charAt(8)+value.charAt(9);
JOptionPane.showMessageDialog(null," "+Month+"/"+Day+"/"+Year+"");
}
else
{
JOptionPane.showMessageDialog(null,"INVALID INPUT!!");
}
}
}
Hello i need help about combing the charAt()'s
for example i would input 05/05/2010
i want to separate them into Month, Day and Year using charAt() method so that i could display them again. but my problem is it seems that it is not allowed to add two or more charAt()'s. any advice on how will i separate them? Thanks in advance.