CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Posts
    2

    convert a string to 64 bit integer in vb.net

    given a string (it may contain numbers or alphabets) i want it to be converted to a 64 bit integer value. i saw a vc++ program in which some shift and or operation is applied and the string converted to a 64 bit value.is there any such method in vb.net ?.after gettting the 64 bit value, i have to apply some permutations to it.can somebody help me

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: convert a string to 64 bit integer in vb.net

    Quote Originally Posted by reshmip
    given a string (it may contain numbers or alphabets) i want it to be converted to a 64 bit integer value. i saw a vc++ program in which some shift and or operation is applied and the string converted to a 64 bit value.is there any such method in vb.net ?.after gettting the 64 bit value, i have to apply some permutations to it.can somebody help me
    You cud use Convert.ToInt64 method to do the conversion..

  3. #3
    Join Date
    Jun 2005
    Posts
    2

    Re: convert a string to 64 bit integer in vb.net

    convert.ToInt64 can be used only if the string contains numbers.it will not accept alphabets.

  4. #4
    Join Date
    Jun 2005
    Posts
    6

    Re: convert a string to 64 bit integer in vb.net

    this is even easier

    CInt(Object as expression)

    this is how i always do it.

    - Josh

  5. #5
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: convert a string to 64 bit integer in vb.net

    Quote Originally Posted by reshmip
    convert.ToInt64 can be used only if the string contains numbers.it will not accept alphabets.
    Can you give a sample of this string? Is it in HEX format? If not how do you convert alphabet into number?
    Good Luck,
    -Cool Bizs

  6. #6
    Join Date
    Jun 2005
    Posts
    6

    Re: convert a string to 64 bit integer in vb.net

    Like I say, just use CInt(string)

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured