You probably saw the method of boxing each number achieves what you are
looking for. A different approach you might prefer is to let format (":)
separate the numbers with blanks then remove the blanks.

   (]#~' '&~:)":>:i.20
1234567891011121314151617181920

I think that the limit on the length of this operation is the same as the
largest list allowed. I don't know what that limit is, but probably large
enough to not be a problem.

On Fri, Sep 9, 2011 at 5:17 AM, Lippu Esa <[email protected]> wrote:

> Hi!
>
> You could use reqular expressions:
>
>   require 'regex'
>    ('\B';' ')rxrplc ":>:i.20 NB. \B = Match except at a word boundary
> 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0
>
> BR,
>
> Esa
>
> -----Original Message-----
> From: [email protected] [mailto:
> [email protected]] On Behalf Of David Vaughan
> Sent: Thursday, September 08, 2011 6:42 PM
> To: [email protected]
> Subject: [Jprogramming] Turn list into string
>
> Hi,
>
> I want to turn a list of integers into string. I've tried this:
>
> 1":>:i.20
> 123456789***********
>
> But I want it to look like: 1234567891011121314151617181920
>
> Also, I was wondering what the limit might be for how long this string is.
>
> Alternatively (preferably actually), I'd like to retain the list but with
> each element being one digit in length. For example, 18 is split into 1 8.
>
> So for >:i.20 I'd want: 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1
> 8 1 9 2 0
>
> Thanks.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> 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