MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to remove the Null character in a Table?


Table[If[i < 3, i], {i, 5}] /. Null -> Sequence[]

{1, 2}

Cases[Table[If[i < 3, i], {i, 5}], _?NumericQ]

{1, 2}


Bob Hanlon


On Mon, Jan 16, 2012 at 5:11 PM, Rex <aoirex at gmail.com> wrote:
> For example,
>
> Table[If[i < 3, i,], {i, 5}]
> will give
> {1, 2, Null, Null, Null}
>
> But I want the result to be {1,2}.
>
> Any trick for this?
>



  • Prev by Date: Re: How to remove the Null character in a Table?
  • Next by Date: Re: Is there any efficient easy way to compare two lists with the same length with Mathematica?
  • Previous by thread: Re: How to remove the Null character in a Table?
  • Next by thread: Re: How to remove the Null character in a Table?