Quote (carteblanche @ 11 Apr 2013 01:23)
convert to char and back to string
could you show it to me on a example?
that's what I got so far:
Code
import java.lang.Integer;
public class Teil1 {
static String toHex(int zahl){
return Integer.toHexString(zahl);
}
static String toUnicode(int zahl){
String zusatz= "";
String hex = Integer.toHexString(zahl);
for(int i=4; i>Integer.toHexString(zahl).length(); i--){
zusatz = zusatz + "0";
}
String erg = zusatz+hex;
return erg;
}
public static void main(String[] args) {
int[] zahl= new int[3];
zahl[0]=48;
zahl[1]=65;
zahl[2]=122;
for(int item: zahl){
System.out.println(item + " " + toHex(item) + " \\u"+ toUnicode(item) );
}
}
}
This post was edited by Samuray on Apr 10 2013 11:38pm