Tuesday, April 1, 2008

Finding ASCII code/value of characters in Java

Hi guys,

Here is a code that will help us out to find ASCII code/value from a string. I used it without any problem and you can also use this function just paste it and it will work fine.


public void fn_FindUTF(String var_str_temp)
{

//Reading a string.
for (int var_next_char = 0; var_next_char < var_str_temp.length(); var_next_char ++)
{

//Here is ascii value is coming out
int var_ascii = var_str_temp.charAt(var_next_char);
System.out.println("ASCII value of " + var_next_char + "is " + var_ascii);
}
}

You can call this function from any where. Pass a string as an argument of this function.

3 comments:

Kush said...

Thats a really nice step buddy,
keep it up am with you..

Kush said...
This comment has been removed by the author.
sundeep said...

Directory