Comment convertir en caractère un integer ???

Résolu
nsslive Messages postés 7 Date d'inscription lundi 27 octobre 2003 Statut Membre Dernière intervention 17 juillet 2007 - 28 déc. 2005 à 19:31
sheorogath Messages postés 2448 Date d'inscription samedi 21 février 2004 Statut Modérateur Dernière intervention 29 janvier 2010 - 28 déc. 2005 à 22:57
salut a tous

je n'arrive pas a convertir un entier en un caractère

genre:

ascii(i)

ou bien char(i) //n'existe pas !

je bute, qq1 connais t il la solution

merci

nss is back

2 réponses

sheorogath Messages postés 2448 Date d'inscription samedi 21 février 2004 Statut Modérateur Dernière intervention 29 janvier 2010 17
28 déc. 2005 à 22:57
String.valueOf(int);
bonne soiree

"n'est pas mort ce qui semble a jamais dormir et en d'etrange temps meme la mort peut mourrir"
3
cs_ducheseb Messages postés 344 Date d'inscription mardi 18 mai 2004 Statut Membre Dernière intervention 23 juin 2006 9
28 déc. 2005 à 22:49
Tu peux essayer d'utiliser cette fonction de la classe String:

String

public String(byte[] bytes,
int offset,
int length,
String charsetName)
throws UnsupportedEncodingException


Constructs a new <tt>String</tt> by decoding the specified subarray of
bytes using the specified charset. The length of the new
<tt>String</tt> is a function of the charset, and hence may not be equal
to the length of the subarray.

The behavior of this constructor when the given bytes are not valid
in the given charset is unspecified. The
CharsetDecoder
class should be used when more control
over the decoding process is required.

* Parameters: :
bytes
- the bytes to be decoded into characters<dd>
offset
- the index of the first byte to decode<dd>
length
- the number of bytes to decode<dd>
charsetName
- the name of a supported
charset


* Throws: :
UnsupportedEncodingException
- if the named charset is not supported
IndexOutOfBoundsException
- if the <tt>offset</tt> and <tt>length</tt> arguments
index characters outside the bounds of the <tt>bytes</tt>
array * Since: : <dd>JDK1.1

"A game is a series of interesting choices." Sid Meier
0
Rejoignez-nous