JuanMtz

Autoevaluación chuletilla

Jan 16th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1.  
  2. public class Autoevaluación_shenanigans {
  3.  
  4.     public static void main(String[] args) {
  5.        
  6.         String texto = "Veni;Vedi,Vinci";
  7.        
  8.         String[] trozos = texto.split("[,;.]"); // Divide el string dentro de un array, elminando
  9.         //los caracteres introducidos en .split
  10.        
  11.         //String[] trozos = texto.split("[(<\\mayus>)]"); wtf esto no funciona
  12.        
  13.        
  14.         System.out.println(trozos[0]);
  15.         System.out.println(trozos[1]);
  16.         System.out.println(trozos[2]);
  17.  
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment