Take an example:
System.out.println("Hello Uni\u03C0");
System.out.println("Hello Esc \\");
it gives something like
Hi Uniπ
Hi Esc \
Is there a way where I can give different values for 03C0 and \ during different iterations in a loop?
for example something like
System.out.format("Hello Esc \%c",'\\');
System.out.format("Hello Esc \%c",'\"');
I know this will give a compiler error. I want to know how to do this.
For example, I would like to print a different Unicode character (e.g., from \ u0000 to \ u00C3) at each iteration of the loop.
For example, I have this function that returns the four-digit hexadecimal value of an integer:
public static String hexa(int a)
{
int x=a;
String b= String.format("%x",x);
if(b.length() == 1)
{
b="000"+b;
}
if(b.length() == 2)
{
b="00"+b;
}
if(b.length() == 3)
{
b="0"+b;
}
return b;
}
Now I would like to join \ u with hexa (i) to get a different Unicode character for different i
source
share