Re: find if any memers of a set are in another set (blank line fi nder)?
- Posted by petelomax at blueyonder.co.uk Jul 19, 2002
- 410 views
{{{ On Fri, 19 Jul 2002 04:49:09 -0700, Dan Moyer <DANIELMOYER at prodigy.net> wrote:
Derek,
Ok, enough people have said "check each for non white-space" is faster, so <snip> My thought is this: space=#32 tab=#09 cr#13 lf=#10
What, if any, cases exist where a byte <=32 is *not* whitespace. What, if any, cases exist where a byte >32 is *not* text?
Hence, replace
Don't take my word for it, test this out on your data. Some foreign characters may fail this simple test. In which case: z=x[i] if z<0 or z>32 then would be my next best bet.
(and yes, I have not tested it, but I would put money on it being faster than if x[i]<0 or x[i]>32 )
2nd: re tab:
If your or my code reads:
a"12345678" b=" " c=" " <use/imagine a non-proportional font where the "s all align>
then the *compiler* will read b={space=#32*8, and c=#09 alone.
You & I might stare in disbelief that b is *NOT* = c
As a text editor will show the same results when you or I hit the space bar eight times or the tab key once, I think it is absolutely correct that the compiler screams "I cannot *KNOW* what you mean"
IE use \t between quotes rather than the tab key.
Pete