My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.lineadecodigo.java.string;

/**
* @file EmailsAcabadosEnDotCom.java
* @version 1.0
* @author Linea de Codigo (http://lineadecodigo.com)
* @date 23-marzo-2010
* @url http://lineadecodigo.com/java/detectar-emails-que-finalicen-en-com/
* @description Utilizar el método .endsWith() para sacar un listado de emails acabados en .com
*/

public class EmailsAcabadosEnDotCom {

public static void main(String[] args) {

String emails[] = {"julio@gmail.com","maria@red.es","lucia@hotmail.com","javi@email.it","laura@telecom.fr",
"sonia@aulambra.com","luis@hotmail.com","pedro@yahoo.com","enrique@fcbarcelona.cat"};


for (String email: emails)
if (email.endsWith(".com")) System.out.println(email);


}

}

Change log

r226 by vcuervo on Mar 22, 2010   Diff
Emails acabados en .com
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 775 bytes, 26 lines
Powered by Google Project Hosting