pumbaa666
Messages postés24Date d'inscriptionjeudi 12 juin 2003StatutMembreDernière intervention19 janvier 2010 19 déc. 2007 à 16:28
Ouais, ou y'a aussi :
String input = "Salut, c'est un test, il marche bien";
String[] result = input.split(", "); // y'a un espace après la virgule
et ça donne :
result[0] contient "Salut";
result[1] contient "c'est un test";
result[2] contient "il marche bien";
polz
Messages postés31Date d'inscriptionsamedi 17 août 2002StatutMembreDernière intervention 6 juin 20061 15 janv. 2003 à 22:13
hello, c'est par pour t'embeter mais il y a qqch de beaucoup plus simple
The following is one example of the use of the tokenizer. The code:
StringTokenizer st = new StringTokenizer("this is, a: test", ",:- ");
while (st.hasMoreTokens()) {
println(st.nextToken());
}
Le stringTokenizer découpera mot par mot "this is a test" qu'il y aie , : - ou un espace, c'est parametrable a souhait
Considère ca comme une aide et non comme une attaque personnelle
19 déc. 2007 à 16:28
String input = "Salut, c'est un test, il marche bien";
String[] result = input.split(", "); // y'a un espace après la virgule
et ça donne :
result[0] contient "Salut";
result[1] contient "c'est un test";
result[2] contient "il marche bien";
15 janv. 2003 à 22:13
The following is one example of the use of the tokenizer. The code:
StringTokenizer st = new StringTokenizer("this is, a: test", ",:- ");
while (st.hasMoreTokens()) {
println(st.nextToken());
}
Le stringTokenizer découpera mot par mot "this is a test" qu'il y aie , : - ou un espace, c'est parametrable a souhait
Considère ca comme une aide et non comme une attaque personnelle