Re: [Rd] strsplit and the empty string

2008-08-21 Thread Wacek Kusnierczyk
Christian Brechbühler wrote: > > I checked Perl, and it does exactly the same: > print join "==", split / /, " hello dolly " > ==hello==dolly > (that's 3 elements: "", "hello", and "dolly"). > try perl -e 'print join "==", split " ", " hello dolly "' ;) vQ _

Re: [Rd] strsplit and the empty string

2008-06-18 Thread Wacek Kusnierczyk
Oh my, I regret my stupidity. Christian Brechbühler wrote: > > With R version 2.6.1 Patched (2007-11-26 r43541), I get > Error in strsplit(" hello dolly ") : > argument "split" is missing, with no default > > But strsplit(" hello dolly ", " ") reproduces your results. > > of course, t

Re: [Rd] strsplit and the empty string

2008-06-18 Thread Christian Brechbühler
On Wed, Jun 18, 2008 at 8:45 AM, Wacek Kusnierczyk <[EMAIL PROTECTED]> asked for opinions: > > When the pattern > matches the beginning of the search string, the empty string is added to > the result, but that's not the case when the pattern matches the end of > the search string: > > strsplit(" he

[Rd] strsplit and the empty string

2008-06-18 Thread Wacek Kusnierczyk
Hello, I am wondering about the behaviour of strsplit. When the pattern matches the beginning of the search string, the mepty string is added to the result, but that's not the case when the pattern matches the end of the search string: strsplit(" hello dolly ") [1] "" "hello" "dolly" The man fo