Results 1 to 10 of 10
  1. #1
    Niko_ is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default How do i convert a stirng with a hexdecimal into an integer?

    Hi as the title says i need help with converting a string with a hexdecimal(00ff00) into an int.
    Any help will be appreciated :)
    Last edited by Niko_; 04-06-2012 at 04:05 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    Moved from JDBC. Whatever made you think that was a suitable section to post this?

    converting a string with a hexdecimal(00ff00) into a string.
    Doesn't make sense. You want to convert a String to a String? It's already a String.

    If, following your topic line, what you really want to do is obtain an int value from a hexadecimal String representation, take a look at the methods of the Integer class.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Niko_ is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    Sorry i mistyped and yes i meant it to be int.

    This is what made me think JDBC was the right section http://www.java-forums.org/jdbc/3707...ut-string.html
    It's the same error
    Last edited by Niko_; 04-06-2012 at 04:09 PM. Reason: added more content to the post

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    That was an old thread from a period when the forum had less moderators.

    I've moved that one too. Thank you for the link.

    Did you find the method you need in the Integer API?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    Niko_ is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    Np and i haven't found it yet. I'm still new to java :)

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    Did you find the API for Integer?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #7
    Niko_ is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    No i have been looking for it on google and in JRE System Lib in eclipse
    Last edited by Niko_; 04-06-2012 at 08:44 PM. Reason: fixed misspelling

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,387
    Rep Power
    25

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    Here is an API link:
    Java Platform SE 6

    Find the name of the class in the lower left and click it for the doc to be shown in the main window
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,508
    Blog Entries
    7
    Rep Power
    20

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    If you're using Jave 1.6, this is the link you should bookmark; if you're using Java version 1.7 this is the link. Make sure you bookmark one of them, you'll need it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    Niko_ is offline Member
    Join Date
    Apr 2012
    Posts
    5
    Rep Power
    0

    Default Re: How do i convert a stirng with a hexdecimal into an integer?

    Thanks

Similar Threads

  1. How to convert integer to String
    By mCoder in forum New To Java
    Replies: 2
    Last Post: 12-27-2011, 04:00 AM
  2. convert integer to double
    By himanwish in forum New To Java
    Replies: 4
    Last Post: 03-17-2011, 01:55 AM
  3. convert unsigned integer to signed integer in java?
    By diskhub in forum New To Java
    Replies: 6
    Last Post: 05-17-2010, 12:50 AM
  4. How to convert Integer[] to int[]
    By Nithya in forum New To Java
    Replies: 26
    Last Post: 02-11-2010, 05:41 PM
  5. how to convert a string to an integer
    By LAW in forum New To Java
    Replies: 6
    Last Post: 11-09-2009, 03:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •