Results 1 to 5 of 5

Thread: Find and replace

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    Find and replace

    how do I search a string for "dimava", and if it finds it, replace dimava with "He". (without quotation marks for both)

    thanks


    ~~~Dimava~~~
    Last edited by dimava; Apr 28th, 2001 at 06:06 PM.
    NXSupport - Your one-stop source for computer help

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Code:
    strFind = Chr(34) & "dimava" & Chr(34)
    strReplace = Chr(34) & "He" & Chr(34)
    
    Text1.Text = Replace(Text1.Text,strFind,strReplace)
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Matthew Gates
    Guest
    Originally posted by crptcblade
    Code:
    strFind = Chr(34) & "dimava" & Chr(34)
    strReplace = Chr(34) & "He" & Chr(34)
    
    Text1.Text = Replace(Text1.Text,strFind,strReplace)

    I believe, as we Americans do, we quote stuff that we are refering to, pretty much.

    So it'd just be like this:


    Code:
    Private Sub Command1_Click()
        Text1.Text = Replace(Text1.Text, "dimava", "He")
    End Sub

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Doh, I read it too quick...I thought it said with quotations...sorry about that...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    crptcblade: thanks for the code
    matt: thanks, but i figured it out
    NXSupport - Your one-stop source for computer help

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