String -> Char (Java Urgent)

  • 17 years ago

    how do you convert a string to a char? i can use parseint and parsedouble but i dont see a parsechar in Character or Char class (doesnt even exist).

  • 17 years ago

    There's 2 methods in String, that seem to be able to do that:


    //static
    String.valueOf(char c);


    and


    //not static
    String a = "Hello";
    char b = a.charAt(4);


    Note that I'm looking at my reference book as
    my Java skills seem to be slowly fading...

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perl - The only language that looks the same before and after RSA encryption.” - Keith Bostic