hey here is what i got.... i get an error after my while statement that i need a ; after my while but that dosent make any since, cause there shouldnt be any ideas???? suppose to be an easy loop statement if the string does not contain @ then keep prompting the user until there is an @ in the string.

* Week_seven_number_twenty_six application
 *
 * @author 
 * @version 1.00 2012/3/14
 */
import javax.swing.JOptionPane;
public class Week_seven_number_twenty_six 
{
    
    public static void main(String[] args) 
    {
    	
    	do
    	{
    		String INPUT = JOptionPane.showInputDialog(null,"Please input what ever you like as long as it contains the '@' symbol");
    	}
    	while(INPUT.contains("@"))
    	{

			System.out.println(""+INPUT);
    	}
    	
    }
}

yes thats what i want to do but when i have it set up and add in ; i get the error cant find the symbol variable INPUT in the while statement...

/**
 * @(#)Week_seven_number_twenty_six.java
 *
 * Week_seven_number_twenty_six application
 *
 * @author 
 * @version 1.00 2012/3/14
 */
import javax.swing.JOptionPane;
public class Week_seven_number_twenty_six 
{
    
    public static void main(String[] args) 
    {
    	
    	do
    	{
    		String INPUT = JOptionPane.showInputDialog(null,"Please input what ever you like as long as it contains the '@' symbol");
    		System.out.println(""+INPUT);
    	
    	}while(INPUT.contains("@"));
    }
}

ok got it thanks! although i think have this a bit backwards i need to get out of the loop when the string contains the @ symbol but when i enter the @ symbol it stays in loop. I know why its doing it but how would you got about reversing it the other way around?

/**
 * @(#)Week_seven_number_twenty_six.java
 *
 * Week_seven_number_twenty_six application
 *
 * @author 
 * @version 1.00 2012/3/14
 */
import javax.swing.JOptionPane;
public class Week_seven_number_twenty_six 
{
    
    public static void main(String[] args) 
    {
    	String INPUT;
    	do
    	{
    	    INPUT = JOptionPane.showInputDialog(null,"Please input what ever you like as long as it contains the '@' symbol");
    		
    	
    	}while(INPUT.contains("@"));
    	
    	System.out.println(""+INPUT);
    }
}

wow brain fart moment thanks forgot about the ! its been a few months since i last coded thanks!!!

/**
 * @(#)Week_seven_number_twenty_six.java
 *
 * Week_seven_number_twenty_six application
 *
 * @author 
 * @version 1.00 2012/3/14
 */
import javax.swing.JOptionPane;
public class Week_seven_number_twenty_six 
{
    
    public static void main(String[] args) 
    {
    	String INPUT;
    	do
    	{
    	    INPUT = JOptionPane.showInputDialog(null,"Please input what ever you like as long as it contains the '@' symbol");
    		
    	
    	}while(!INPUT.contains("@"));
    	
    	System.out.println(""+INPUT);
    }
}
This question has already been answered. Start a new discussion instead.