Hi, well, the idea was to be somwhat optimized and since haystack may be big, I wanted to avoid a strlen on haystack. And the double test doesn't optimize anything actually, I thought it was a good idea earaly this morning but it's not. A simple while (*p != '\0') is better actually. Cheers, Bruno