On Apr 08, 2007, at 18:56 UTC, Dennis Birch wrote:

> "Split takes two parameters, the first being the string being split,
> and the second being the delimiter. The delimiter parameter has a
> default value of a Space (" "). When splitting by spaces, EndOfLine
> is not a valid delimiter."
> 
> It seems to me that Split is somewhat useless if it doesn't take into
> account an EndOfLine in the middle of a chunk of text it's splitting.

I disagree; I use it all the time.  It's perhaps my most
frequently-used string function.  I find its well-defined semantics
quite useful.

> If it included an array element that had the word before the
> EndOfLilne, the EndOfLine and the word after the EndOfLine, I could
> consider that functional (although not as useful as I would hope),
> but it didn't. In the sample project I included, the words after an
> EndOfLine simply do not appear in the array. Does anybody else agree
> that this is less than ideal or even incorrect functionality?

Not me.  I agree with Steve; I don't think you understand what it's
doing, which is very simple: splitting a string into substrings based
on whatever delimiter you specify.

If your goal is to split a string into words based on spaces *or*
EndOfLine characters, then simply do:

  s = ReplaceLineEndings( s, " " )
  words = Split(s, " ")

But if you haven't explicitly written your code to treat line endings
the same as spaces, then it shouldn't do so.

Best,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to