in reply to Re^5: Truncating after the last period
in thread Truncating after the last period
I'm sure by now it's clear to Simon, the OP, how useless your code is to him in its defective state. That's all that matters.
It's astonishing you continue to repost the same defective code over and over again—this time with the evidence of the obviously wrong result included in the code!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Truncating after the last period
by BrowserUk (Patriarch) on Aug 23, 2011 at 02:15 UTC | |
I'm sure by now it's clear to Simon, the OP, how useless your code is to him in its defective state. That's all that matters. If, by useless, you mean that as posted it can result in a string of 401 characters in length (and if so, wouldn't it have saved an great deal of time if you'd just come out and said that instead of trying to be snide!), then I guess you haven't actually thought about why that might be so. Much less actually tried it on realistic data. Consider the case where the first sentence (minus the period) in the string is exactly 400 characters in length:
Is it better to keep the extra character, or discard the whole sentence? Unrealistic you might say, except that other than my clumsy extension (following the ;), that sentence is verbatim from Wikipedia. And James Joyce's famous Ulysses, contained many long sentences, including one 11,281 words long, and another 12,931 words long. But even without such run-ons, the point still holds:
Is it better to retain the extra character, or discard the whole of the last sentence? When I was writing a search with context function a while back, in consultation with others, I concluded that the former is preferable. But, should the OP decide that he simply cannot afford to retain that extra character, I'm quite certain that he is quite capable of seeing the same simple workaround that you've claimed to have seen(*). He can make up his own mind on the issue. (*)Of course, if you'd just come out with the problem you perceived, and offered your solution to it, instead of trying to come across all superior, then we could have saved a about 20 posts and a bunch of time. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |