|
|
|
Salut, j'ai pas trés bien compri ce que tu voulais faire, mais en règle générale, pour convertir un int en string, ya la méthode toString(),
int c = 2; string chaine = c.toString(); Ce code met "2" dans la variable chaine. Maintenant, si tu fais une différence entre 2char, je ne sais plus quelle méthode permet de récupérer le code ascii correspondant. |
Salut
le plus simple est d'utiliser la méthode statique de "String", valueOf(int i), celle ci te renvoie la valeur en String de l'argument. Cette méthode fonctionne également avec d'autres types static String valueOf(boolean b) Returns the string representation of the boolean argument. static String valueOf(char c) Returns the string representation of the char argument. static String valueOf(char[] data) Returns the string representation of the char array argument. static String valueOf(char[] data, int offset, int count) Returns the string representation of a specific subarray of the char array argument. static String valueOf(double d) Returns the string representation of the double argument. static String valueOf(float f) Returns the string representation of the float argument. static String valueOf(int i) Returns the string representation of the int argument. static String valueOf(long l) Returns the string representation of the long argument. static String valueOf(Object obj) Returns the string representation of the Object argument. Chouba, Pochard d'assaut ..
|
MERCI :-)
j'ai réussi grace a toi à faire ce que je voulais :-) a+ lilou |
à vot'service ...
Chouba, Pochard d'assaut .. |
le char peut etre un int ou un string mais pas l'inverse si on pense ou String;
exemple; char a='A'; int c=a+1; //c=65 car dans cette cas le a=64, 'A'=64,'B'=65,..; donc si on fait char x=c;// donc x est le caractère 'B' enfin pour convertir le int ou le char en String tu peut faire le casting exemple; String x=""+c/......... |
en fait j'ai ajouté un composant TListImage dans mon app delphi, j'ai ajouté des images dans la liste des images mais elles
n'apparaissent pas au niveau de la proprioté ImageIndex. Alors j'ai besoin de votre aide |
Bonjour quel-qu'un peut t'il me dire comment quond écris 20 en numérique
merci :) |
| 30/05 15h36 | [java] conversion byte[] en char[] | Programmation | 31/05 18h54 | 6 |
| 31/08 16h50 | [java] conversion Hexa => Ascii | Programmation | 31/08 16h55 | 2 |
| 10/12 00h46 | [C++] programme de conversion chiffres en mot | Programmation | 11/12 21h37 | 1 |
| 21/05 17h05 | [C] Conversion int => char | Programmation | 21/05 20h40 | 2 |