getting the number associated to a char in a string

I've this code:

String text = ...

counterchar = ...

char currentchar = text.charAt(counterchar);

Some characters in that string are not "printable" with the System.out.println(text),

because thay are somekind of bookmarks for special instructions..

In few words I need to see their value.

In C the char is equivalent to 8 bit integer, In Java how can i get the integer associated to a String character?

thanks

[499 byte] By [Leonardo_Da_Vincia] at [2007-10-2 20:26:26]
# 1

> In C the char is equivalent to 8 bit integer, In Java

> how can i get the integer associated to a String

> character?

Is this what you're looking for?

int i = "foo".charAt(0);

System.out.println(i); // 102

In Java, a char is a 16-bit unsigned value.

~

yawmarka at 2007-7-13 23:09:24 > top of Java-index,Java Essentials,New To Java...