Posted by: LondonBridge February 20, 2008
Help with Java programming
Login in to Rate this Post:     0       ?        
      Here it goes:      

       String a="Nepal is beautiful";
       String b="";    

        int n=a.length();
        for(int i=0;i<n;i++){
            if(Character.isWhitespace(a.charAt(i))){
                b+=" ";
            }
            else{
                b+="*";
            }
        }
       System.out.println(b);
Read Full Discussion Thread for this article