If you don't need to preserve the Null character (and speed isn't that important, or you have small strings!), you could always strip your strings ahead of time using something like (replaces all ascii '0' with ascii '1'): (Not tested)
Also, MID$ doesn't work in reverse like some BASIC languages? Such as:
If modifying INSTR$ and REPLACE$ to fix this slows these commands down, perhaps adding two new functions may be better?
(INSTRB$, REPLACEB$ or something (B for Bytes like other languages), although the non 'B' versions usually offer non-case sensitive options).
Just some ideas.
Code (glbasic) Select
FUNCTION String_ReplaceNulls$: string$
LOCAL ix%
FOR ix = 0 TO LEN(string$) - 1
IF ASC(MID$(string$, ix, 1)) = 0 THEN string$ = MID$(string$, 0, ix-1) + CHR$(1) + MID$(string$, ix+1)
NEXT
RETURN string$
ENDFUNCTIONAlso, MID$ doesn't work in reverse like some BASIC languages? Such as:
Code (glbasic) Select
IF . . . THEN MID$(string$, ix, 1) = CHR$(1)If modifying INSTR$ and REPLACE$ to fix this slows these commands down, perhaps adding two new functions may be better?
(INSTRB$, REPLACEB$ or something (B for Bytes like other languages), although the non 'B' versions usually offer non-case sensitive options).
Just some ideas.
