MathGroup Archive 2006

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

Search the Archive

Re: Null's not null?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69404] Re: [mg69393] Null's not null?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 11 Sep 2006 05:38:41 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

replaceNullWithEmptyString[x_]:=
    (x/._?(ToString[#]=="Null"&):>"");

$PrePrint=replaceNullWithEmptyString[#]&;

a=ReplacePart[Array[x,{4,3}], Null, {2,3}]

{{x[1, 1], x[1, 2], x[1, 3]}, {x[2, 1], x[2, 2], ""}, {x[3, 1], x[3, 2], x[3, 3]}, 
  {x[4, 1], x[4, 2], x[4, 3]}}


Bob Hanlon

---- AES <siegman at stanford.edu> wrote: 
> Putting Null into one or more slots in a Table and printing the Table 
> shows "Null" (without quotes) at the corresponding positions, as also 
> does ToString[Null].  I don't think that's what the Help message says:
> 
>       "Null is a symbol used to indicate the absence of an 
>        expression or a result. When it appears as an output 
>        expression, no output is printed."
> 
> I can use a string with a couple of empty spaces ("__") to represent an 
> occupied but not empty slot in a Table, but that just looks clumsy to 
> me.  Is there a truly non-printing Null symbol?
> 


  • Prev by Date: Re: ReplaceAll (/.)
  • Next by Date: Re: Why does Mathematica change the precision of an expression to check equality?
  • Previous by thread: Re: Null's not null?
  • Next by thread: Re: Null's not null?