Mathematically, the null string is a substring of every string, so it should be that if you search for the null string, it matches everything. If you prefer, you can look at the code this way:. Notice that if the string length is zero, there is an integer underflow, and we end up reading off the end of the buffers.
No virtual memory here, so there is no page fault when you run off the end of a buffer; you just keep going and reading from other parts of your data segment.
The bug became a feature. The integer underflow was fixed, but the code is careful to treat null strings as never matching, in order to preserve existing behavior. Comments are closed. Count the total distinct number of lines;. Count the total number of lines per group. So, from the previous example, our counting would be:. Total lines: 7. Total distinct lines: 2. Total lines per group:. Hope I was clear enough,. Office Office Exchange Server.
Not an IT pro? Script Center. Sign in. United States English. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. September 21st, , AM 5. You're Welcome. All you'll get then is simply the number of lines. Quick Navigation Windows 3. Feedback Doctor's Lounge.
All times are GMT The time now is AM. If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.
0コメント