spbaena 0 Denunciar post Postado Março 8, 2004 PessoalAlguém tem algum metodo de validação de endereço de email pra postar ai??Algum que seja completo, não apenas um com indexOf("@")Valeu!! Compartilhar este post Link para o post Compartilhar em outros sites
spbaena 0 Denunciar post Postado Março 8, 2004 encontrei: public boolean checkEmail( String af_email ) { boolean ok = false; int atPos = af_email.indexOf( "@" ); // Verifica se existe "@" no endereço // Verifica se o endereço inicia ou termina com "@" if( (atPos <= 0) || (atPos == af_email.length()-1) ) { ok = false; } else { // Não é permitido espaços em branco em um endereço de email if( af_email.indexOf( " " ) > -1 ) { ok = false; } else { ok = true; } } char ch; for( int i=0; i<af_email.length(); i++ ) { ch = af_email.charAt(i); if( (ch>=0 && ch<=31) || (ch==34) || (ch==127) ) { ok = false; break; } } return ok;} Compartilhar este post Link para o post Compartilhar em outros sites