Reason for asking: I thought if the string had no text, then I should use #PB_String_NoCase to speed it up, but it actually makes it slower.
Code: Select all
Procedure.s RemoveDoubleSpaces(text$)
While FindString(text$," ");,1,#PB_String_NoCase)
text$=ReplaceString(text$," "," ");,#PB_String_NoCase)
Wend
ProcedureReturn text$
EndProcedure
DisableDebugger
start.q=ElapsedMilliseconds()
For a=1 To 500000
text$=RemoveDoubleSpaces("Hello World, How Are You Today?")
Next
time.q=ElapsedMilliseconds()-start
EnableDebugger
Debug time ; 2800 ms without #PB_String_NoCase, but 5700 ms with it?

