Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: compressed list output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19716] Re: [mg19671] compressed list output
  • From: BobHanlon at aol.com
  • Date: Mon, 13 Sep 1999 02:40:52 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Rita,

trimList[x_List] := StringReplace[
    ToString[x], {", 0." -> ",.",  ", " -> ",", "{0." -> "{."}]

test = {0.1, 0.35, 0.6, 1.4, 2.62291, 6, 20};

test // trimList

"{.1,.35,.6,1.4,2.62291,6,20}"

(% // ToExpression) == test

True


Bob Hanlon

In a message dated 9/9/1999 6:14:06 AM, R.Bijlsma at iri.tudelft.nl writes:

>I want to output a list as short as possible, but including
>  all information:
>
>   {0.1, 0.35, 0.6, 1.4, 2.62291, 6, 20}
>
>  Should preferably by written as:
>
>   {.1,.35,.6,1.4,2.62291,6,20}
>    
>  Can someone tell me how to do this? Changing the separator
>  from ", " to "," would already help a lot!
>


  • Prev by Date: 3D Projection
  • Next by Date: Re: Manipulating a list of pairs
  • Previous by thread: Re: compressed list output
  • Next by thread: Finding a relative prime