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
|
String input = "mm-34-34-34-1-1-1-WaterBear-Lord Bisounours-PeachySkin-"+
"\n-mc-30-30-28-5-1-5-PeachySkin-WaterBear-Tazz-"+
"\n-md-28-28-28-1-1-1-Defender-WaterBear-Tazz";
String test = JOptionPane.showInputDialog(null, "entrez la recherche <a faire");
Scanner s = new Scanner(input).useDelimiter("-");
do
{
while (s.hasNext())
s.findInLine(test);
if (s.hasNextLine())
{
s.nextLine();
}
else
System.out.println("Ça marche pas");
}
while(s.hasNext());
MatchResult result = s.match();
System.out.println(result);
s.close(); |
Partager