lafolle24320
Messages postés406Date d'inscriptionsamedi 26 mars 2005StatutMembreDernière intervention29 juin 2009
-
27 nov. 2006 à 16:57
cs_physio
Messages postés26Date d'inscriptionvendredi 1 novembre 2002StatutMembreDernière intervention 3 février 2007
-
10 déc. 2006 à 17:12
Re bonjour,
dsl pour tous ces posts d'aujourd'hui mais je bloque.
Enfin voilà mon pb je voudrais parcourir un string en commencant par la fin jusqu'au caratère "" et mettre dans un nouveau string ce que l'on a trouvé.
cs_physio
Messages postés26Date d'inscriptionvendredi 1 novembre 2002StatutMembreDernière intervention 3 février 20072 10 déc. 2006 à 17:08
Bonjour, voici une solution :
String t="TexteAvant\\TexteApres"; // la chaine a analyser
int position=t.indexOf((int)'\\',3); // trouve la position du '\' dans la chaine
String t1=t.substring(0,position); // extrait la chaine a gauche
String t2=t.substring(position+1, t.length()); // extrait la chaine a droite
cs_physio
Messages postés26Date d'inscriptionvendredi 1 novembre 2002StatutMembreDernière intervention 3 février 20072 10 déc. 2006 à 17:12
rectification :
tring t="TexteAvant\\TexteApres"; // la chaine a analyser
int position=t.indexOf((int)'\\'); // trouve la position du '\' dans la chaine
String t1=t.substring(0,position); // extrait la chaine a gauche
String t2=t.substring(position+1, t.length()); // extrait la chaine a droite