VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A fast replace-function

by Kristian S. Stangeland (8 Submissions)
Category: String Manipulation
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (13 Votes)

The Replace-function in VB6 is an extremely useful in many occasions, but unfortunately, it is as most string-functions in VB rather slow. Therefore I’ve tried to optimize this operation, and I must say the result is satisfying – it is nearly 50 times faster replacing 35.000 characters than the native Replace-function.
The code should also work in VB5, where the native function doesn’t even exist.

Inputs
As Replace in VB6, only that "Start" is now defining the position within the expression where the substring search is to begin.
Code Returns
The string replaced.

Rate A fast replace-function

Download A fast replace-function

Download A fast replace-function (8 KB)

A fast replace-function Comments

No comments have been posted about A fast replace-function. Why not be the first to post a comment about A fast replace-function.

Post your comment

Subject:
Message:
0/1000 characters