Ascii & java - urgent svp

guigui -  
 guigui -
je voudrais savoir comment passer d'un code ascii (ou hexa) en String
par exemple, si j'ai 92 en ascii ou 5C en hexa, je voudrais obtenir "\"
merci
A voir également:

3 réponses

guigui
 
c'est plus la peine, j'ai trouvé
0
Jean-François Pillou Messages postés 19261 Date d'inscription   Statut Webmaster Dernière intervention   63 279
 
Pourrais-tu donner la réponse STP? :-)
0
guigui
 
c'est tout con :

//tu mets ton code ascii dans un char
char myCode=92;
System.out.println(myCode); // tu as bien ton antislash

//et apres tu le transforme en string:
String myAntiSlash = new String();
myAntiSlash=myAntiSlash.valueOf(monChar);
System.out.println(myAntiSlash); // tu as toujours ton antislash

0