Results 1 to 10 of 10

Thread: Which is faster ?

Threaded View

  1. #10
    Member
    Join Date
    Sep 2005
    Location
    Netherlands, The
    Posts
    41

    Re: Which is faster ?

    using repalce like that is VERY slow, your arguments are not right.
    since evry time it will loop trough the whole string while it has found its match already (count = -1)
    maybe thats why bruce got confused

    try this instead(out of hand) i cant think of anything faster
    VB Code:
    1. dim iX as long
    2. dim iY as long
    3. dim iZ as long
    4.  
    5. iz = len("replaced")
    6. ix = instr(1, strLargeString, "{", vbtextcompare)
    7. do while ix > 0
    8.   iy = iy +1
    9.   strLargeString = Replace(strLargeString, "{" & iy & "}", "replaced", ix, 1, vbtextcompare)
    10.   ix = instr(ix + iz, strLargeString, "{", vbtextcompare)
    11. loop
    Last edited by Mitsukai; Apr 7th, 2006 at 10:24 AM.

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