I had
rtz =: }: ^: ((0 = {:)*.0<#) ^: _
--Kip
On Wednesday, March 30, 2016, Roger Hui <[email protected]> wrote:
> There's also
>
> rt0=: }.~ -@(#.~)@(0&=)
>
> On Wed, Mar 30, 2016 at 8:24 AM, Roger Hui <[email protected]
> <javascript:;>>
> wrote:
>
> > rtz=: #~ +./\.@(0&~:)
> >
> > On Wed, Mar 30, 2016 at 8:13 AM, Kip Murray <[email protected]
> <javascript:;>>
> > wrote:
> >
> >> How do you remove trailing zeros from a vector?
> >>
> >> rtz 0 1 2 3
> >> 0 1 2 3
> >> rtz 0 1 2 0
> >> 0 1 2
> >> rtz 0 1 0 0
> >> 0 1
> >> rtz 0 0 0 0
> >>
> >> --Kip Murray
> >>
> >>
> >> --
> >> Sent from Gmail Mobile
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
Sent from Gmail Mobile
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm