Results 1 to 5 of 5

Thread: How to Convert "TEXT" to TEXT? Remove the quotations?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    Kansas
    Posts
    20

    How to Convert "TEXT" to TEXT? Remove the quotations?

    I have a text file that I load into a list box(seems easier to search and use index to reference items in list).

    It starts out like this:

    begin general_information
    &nbsp name "Example"
    &nbsp designer "Steve McNally"



    I need to get rid of the quotation marks from both sides of the word "Example" and "Steve McNally".
    I can get rid of the mark on the left with Mid (String)

    txtName = Mid(List2.List(1), 9) wich produces: Example"
    txtDesigner = Mid(List2.List(2), 13) &nbspproduces: Steve McNally"

    I've tried mixing the Mid function with the Left and the Right functions, but get odd results like: ample""Ex

    Then, I'm going to print it back to a text file, but I'll be able to Print the " " back around them no problem.

    I'd appreciate any help. I'm still kind of a novice so, if you could just paste some code please.

    Ian

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Use the Replace function......
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Fanatic Member Illspirit's Avatar
    Join Date
    Mar 2001
    Location
    Blackpool, England
    Posts
    815
    quickest way would be
    VB Code:
    1. Dim s As String
    2.     s = """blah"""
    3.     s = Replace(s, """", vbNullString)

    but that would get rid of all quoty things
    Illspirit - [email protected]

    SmartBarXP Lead Developer
    SmartBarXP - The leading desktop sidebar application for Microsoft Windows XP

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    Kansas
    Posts
    20
    lol, there's a Replace Function?
    Thanks, it works too!!

    Ian

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by IanL
    lol, there's a Replace Function?
    Thanks, it works too!!

    Ian
    Yeah... sometimes it's just that easy.....
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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