Tag: string manipulation

Faster ways of finding a character inside a string, in PureBasic.

Posted by on March 3, 2008

For those of you who either prototype or work with PureBasic on a daily basis, if you ever found yourself looking for faster ways of performing string manipulation, while still using the string system this language provides, be glad for I’ll be posting a few of my solutions to speed up the process.

My first entry is the FindChar() routine. Unlike the official FindString(), this one only searches for a single character. In situations where you’ll be dealing with single character string searches rather than multi-character, this routine will give you up to 2x speed increase in both Ascii and Unicode modes. Worst case scenario, you’ll get equal results speed-wise.

The FindChar() code can be found at > here <

More…