emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rationale for split-string?


From: Luc Teirlinck
Subject: Re: Rationale for split-string?
Date: Tue, 22 Apr 2003 11:26:18 -0500 (CDT)

Stephen Turnbull wrote:

   Note that Miles's proposal would actually give the behavior you want
   in `(split-string string "\n")'.  (Admittedly, you'd like
   `(split-string string "\n" 'end)' even better.)  Point for Miles!

Just to make sure I understand what you are proposing:

I could not just do (split-string string "\n"), I would first have to
check whether the string ended in a newline and, if so, remove that
newline before calling split-string (or do something else).  Otherwise
split-string would return a "fake" empty line at the end of a newline
terminated buffer or file.  (Correct?)  Or are you actually suggesting
to remove a final empty match, but keep any initial empty match,
exactly the behavior I suggested for "end".

That is, would (split-string "\n" "\n") return ("" "") or ("") ?

Sincerely,

Luc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]