Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ejerciciotokenizer;
- import java.util.StringTokenizer;
- public class Ejerciciotokenizer {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- String frase = "(15-10-2012) # Constanza Pardo # 19";
- StringTokenizer s = new StringTokenizer(frase, "#");
- if(s.hasMoreElements()){ //comprueba si despues del gatito hay mas contenido
- System.out.println("La fecha es"+ s.nextToken());
- System.out.println("El nombre es"+ s.nextToken());
- System.out.println("Edad"+ s.nextToken());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement