|
-
Apr 6th, 2006, 11:06 AM
#1
Thread Starter
Frenzied Member
Which is faster ?
Imagine I have a variable that has a lot of text in it, let's call it strLargeString, and in it, there's string like {1}, {2}, {3}, etc.. what would be faster?
VB Code:
For x = 1 to 100
strLargeString = Replace(strLargeString, "{" & x & "}", "replaced")
Next
Or
Loop through the string using InStr to find the first {, then the next } and replace it after and move to the next ?
The first option, I let VB internal function to do the work, which could be faster, but is always has to start from the beginning. The second option, I keep moving the cursor to towards the end...
What are your thoughs on this ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|