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.