Here's an example:
   xs =. 'a';'b';'c'
   join =: #@[ }. [:;,L:0
   '' join xs
abc
   ' ' join xs
a b c

Keep in mind that J strings are arrays of characters. There are no special
functions for strings, because there's never a reason to restrict the
domain of an array function to strings.

Marshall

On Fri, Nov 4, 2011 at 3:54 PM, Andrew Pennebaker <
andrew.penneba...@gmail.com> wrote:

> Ah, Raul Miller has an intuitive
> join<http://permalink.gmane.org/gmane.comp.lang.j.programming/10302
> >function.
>
> join =: #@[ }. [:;,L:0
>
> I'd give an example, but I can't find A) a split function that doesn't give
> a domain error or B) syntax for a literal array of strings.
>
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>
> On Fri, Nov 4, 2011 at 3:49 PM, Andrew Pennebaker <
> andrew.penneba...@gmail.com> wrote:
>
> > Can someone give an example of joinstring? I want to join a list of
> > strings together as one string.
> >
> > Something like (forgive my syntax):
> >
> > xs =: 'a' 'b' 'c'
> > alltogether =: '' joinstring xs
> > byspaces =: ' ' joinstring xs
> >
> > Cheers,
> >
> > Andrew Pennebaker
> > www.yellosoft.us
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to