Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

list of digits to string

  • To: mathgroup at
  • Subject: [mg33702] list of digits to string
  • From: Murray Eisenberg <murraye at>
  • Date: Mon, 8 Apr 2002 03:04:32 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • Reply-to: murray at
  • Sender: owner-wri-mathgroup at

How do I convert a list of bits, say {0, 1, 1, 0, 0}, to a corresponding
character string, "01100"?  Just for bits, the expression

  StringJoin[lis /. {0 -> "0", 1 -> "1"}]

does what I want.  But, more generally, how do I do the same with
arbitrary digits?  The expression similar to the above but for all 9
digits 0, 1, 2, ..., 9 seems overly long.  Is there an easier way?

(I have the unpleasant feeling that I've asked this before.  It's
apparently just one of those things that I cannot readily find in Help.)

Murray Eisenberg                     murray at
Mathematics & Statistics Dept.       
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street
Amherst, MA 01375

  • Prev by Date: Re: Plot inset?
  • Next by Date: RE: Optional
  • Previous by thread: RE: function assignment to list of functions
  • Next by thread: Re: list of digits to string