Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Strip Decimal From String

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    179

    Resolved [RESOLVED] [2005] Strip Decimal From String

    What would be the easiest way to take a string such as "2985.24" and strip the decimal from the string so it looks like "298524".

    Thanks for the help!

    Eroc

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Strip Decimal From String

    String.Replace() is the answer. Try:
    VB Code:
    1. Dim myDecNum As String = "2985.24"
    2. Dim myNewNum As String = myDecNum.Replace(".", "")
    3. 'If you want to get the integer then just parse it
    4. Dim myIntNum As Integer = Integer.Parse(myNewNum)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    179

    Re: [2005] Strip Decimal From String

    Didn't see the replace, how blind can I be?

    Thx for the help, that was what I was looking for !!

    Eroc

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