MathGroup Archive 2010

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

Search the Archive

Re: create character listing

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112563] Re: create character listing
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Mon, 20 Sep 2010 05:42:39 -0400 (EDT)
  • References: <i74lmb$jjp$1@smc.vnet.net>

A question that will most likely evoke dozens of answers. Here are
three of mine:


Table[FromCharacterCode[{c1, c2, c3}], {c1, ToCharacterCode["a"][[1]],
     ToCharacterCode["b"][[1]]}, {c2, ToCharacterCode["a"][[1]],
    ToCharacterCode["z"][[1]]}, {c3, ToCharacterCode["a"][[1]],
    ToCharacterCode["z"][[1]]}
   ] // Flatten // Column

StringJoin @@@
  Tuples[{CharacterRange["a", "b"], CharacterRange["a", "z"],
    CharacterRange["a", "z"]}] // Column

Table[
StringJoin[{c1, c2, c3}],
{c1, CharacterRange["a", "b"]},
{c2, CharacterRange["a", "z"]},
{c3, CharacterRange["a", "z"]}
   ] // Flatten // Column

Cheers -- Sjoerd

On Sep 19, 11:38 am, shippee <slship... at gmail.com> wrote:
> What would be the best way to create a character/string listing of all
> values in columnar format from "aaa" through "bzz"?  I'd like to end
> up with something like:
>
> aaa
> aab
> aac
> ...
> ...
> bzz
>
> Thanks in advance, I've been away from Mathematica for a couple of
> years and forgotten almost everything I'd ever learned, so I'm
> starting over.  All I could find in searching this list was variations
> on the distribution of "abc", if I missed a more on point posting
> please point me in the right direction.



  • Prev by Date: Re: create character listing
  • Next by Date: Re: create character listing
  • Previous by thread: Re: create character listing
  • Next by thread: Re: create character listing