Loading ...
Sorry, an error occurred while loading the content.

Removing text Strings

Expand Messages
  • imagelnk@aol.com
    Hi, i need to know that if i have a variable defined as a string, and i dont know its position, if i can remove it from a text box? we will call the variable
    Message 1 of 4 , Mar 14, 1999
    View Source
    • 0 Attachment
      Hi, i need to know that if i have a variable defined as a string, and i dont know its position, if i can remove it from a text box?
      we will call the variable mystring$

      i want VB to find the mystring$ amongst the rest of the string Text1.text and replace it with "" is this possible since i dont know the exact string or position?

      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/vbhelp
      Free Web-based e-mail groups by eGroups.com
    • Jason Roozee
      I am hoping you are using Vb6, because it has a function defined for that. If your using VB6, then do this: begin routine Private Sub RemoveString(mystring$,
      Message 2 of 4 , Mar 14, 1999
      View Source
      • 0 Attachment
        I am hoping you are using Vb6, because it has a function defined for that.

        If your using VB6, then do this:

        ' begin routine
        Private Sub RemoveString(mystring$, txtctl as TextBox)

        txtCtl.text = replace(txtctl.text, mystring$, empty)

        end sub
        ' end routine
        ' simply just call this fuction like this:
        ' Call RemoveString "junk", text1

        If you are NOT using Vb6, then try this:


        Private Sub RemoveString(mystring$, txtctl as textbox)

        Dim xPos as Integer
        xPos = Instr(txtCtl.text, mystring$)
        While not xPos = 0
        txtCtl.selstart = xPos
        txtCtl.sellenght = len(mystring$)
        txtctl.seltext = ""
        doevents
        wend
        end sub


        - Jason Roozee
        Visual Basic Help Center
        www.vbhelp.com






        -Jason Roozee
        ====================
        Centrix Technologies, Inc.
        PO Box 723
        Hampshire, IL 60140

        Providing custom software solutions!
        Check out our X-Mailer anonymous e-mailer!

        WWW: http://www.centrixtech.com
        E-mail: info@...
        -----Original Message-----
        From: imagelnk@... <imagelnk@...>
        To: vbhelp@egroups.com <vbhelp@egroups.com>
        Date: Sunday, March 14, 1999 9:16 PM
        Subject: Removing text Strings


        >Hi, i need to know that if i have a variable defined as a string, and i
        dont know its position, if i can remove it from a text box?
        >we will call the variable mystring$
        >
        >i want VB to find the mystring$ amongst the rest of the string Text1.text
        and replace it with "" is this possible since i dont know the exact string
        or position?
        >
        >------------------------------------------------------------------------
        >Internet FileZone: Always FREE!
        >Instantly store & access your valuable PC files on the net,
        >from any Web browser.
        >SIGN UP NOW - http://offers.egroups.com/click/235/0
        >
        >eGroup home: http://www.eGroups.com/list/vbhelp
        >Free Web-based e-mail groups by eGroups.com
        >
        >



        ------------------------------------------------------------------------
        eGroup home: http://www.eGroups.com/list/vbhelp
        Free Web-based e-mail groups by eGroups.com
      • Imagelnk@aol.com
        thanks, i got it right after i maled you, but thanks anyway :) ... eGroup home: http://www.eGroups.com/list/vbhelp Free Web-based e-mail groups by eGroups.com
        Message 3 of 4 , Mar 15, 1999
        View Source
        • 0 Attachment
          thanks, i got it right after i maled you, but thanks anyway :)

          ------------------------------------------------------------------------
          eGroup home: http://www.eGroups.com/list/vbhelp
          Free Web-based e-mail groups by eGroups.com
        • VBHelp
          Text1.SelStart = Instr(Text1.Text, mystring$) Text1.SelLength = Len(mystring$) Text1.SelText = - Matt H - http://matthart.com ... From: imagelnk@aol.com
          Message 4 of 4 , Mar 15, 1999
          View Source
          • 0 Attachment
            Text1.SelStart = Instr(Text1.Text, mystring$)
            Text1.SelLength = Len(mystring$)
            Text1.SelText = ""

            - Matt H
            - http://matthart.com

            -----Original Message-----
            From: imagelnk@... <imagelnk@...>
            To: vbhelp@egroups.com <vbhelp@egroups.com>
            Date: Sunday, March 14, 1999 8:17 PM
            Subject: Removing text Strings


            >Hi, i need to know that if i have a variable defined as a string, and i
            dont know its position, if i can remove it from a text box?
            >we will call the variable mystring$
            >
            >i want VB to find the mystring$ amongst the rest of the string Text1.text
            and replace it with "" is this possible since i dont know the exact string
            or position?
            >
            >------------------------------------------------------------------------
            >Internet FileZone: Always FREE!
            >Instantly store & access your valuable PC files on the net,
            >from any Web browser.
            >SIGN UP NOW - http://offers.egroups.com/click/235/0
            >
            >eGroup home: http://www.eGroups.com/list/vbhelp
            >Free Web-based e-mail groups by eGroups.com
            >
            >


            ------------------------------------------------------------------------
            eGroup home: http://www.eGroups.com/list/vbhelp
            Free Web-based e-mail groups by eGroups.com
          Your message has been successfully submitted and would be delivered to recipients shortly.