Results 1 to 3 of 3

Thread: How to replace Tab characters?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Resolved How to replace Tab characters?

    Esteemed Forum Members and Lurkers:

    How do I remove Tab characters out of a string?

    I have strings read from a tab delimited file, and I need to trim and split them.

    The following works elsewhere, but NOT in VB.Net.


    Dim tempstr As String

    ' Simulate my string from the file - Chr(9) is a Tab
    tempstr = "336" & Chr(9) & "G1"

    Replace(tempstr, Chr(9), " ")
    MsgBox(Asc(Mid(tempstr, 1, 1))) ' 51 - 3
    MsgBox(Asc(Mid(tempstr, 2, 1))) ' 51 - 3
    MsgBox(Asc(Mid(tempstr, 3, 1))) ' 54 - 6
    MsgBox(Asc(Mid(tempstr, 4, 1))) ' 9 Tab - Should be space!
    MsgBox(Asc(Mid(tempstr, 5, 1))) ' 84 - G
    MsgBox(Asc(Mid(tempstr, 6, 1))) ' 49 - 1

    Any comments, suggestions, or assistance would be greatly appreciated.
    Last edited by Webtest; Feb 2nd, 2005 at 03:38 PM.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

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