Results 1 to 5 of 5

Thread: find and replace

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Location
    india
    Posts
    4

    Talking find and replace

    can someone give me the code for a find and replace functionality in a string.......
    it wud b really helpful...
    thanx a zillion

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    just use the replace function :
    Code:
    Private Sub Form_Load()
    
        Dim strTemp As String
        
        strTemp = "the cat sat on the mat"
        
        MsgBox Replace(strTemp, "the", "a")
        
    End Sub

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629

    Replace

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim s As String
    3.     s = "teep dimdidumdiada lakdsjfpc teep and this is a testeep"
    4.     s = Replace(s, "teep", "peet")
    5.     MsgBox s
    6. End Sub
    -= a peet post =-

  4. #4
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Replace

    Originally posted by peet

    "teep dimdidumdiada lakdsjfpc teep and this is a testeep"
    You're starting to sound like crptblade now.

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    hehehe... I take that as a compliment

    hes my Turbo Gimp hero
    -= a peet post =-

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