MathGroup Archive 2004

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

Search the Archive

Re: Pad a sign - and + to a list of lists


On Jul 29, 2004, at 7:45 AM, sean kim wrote:

> consider a list of lists
>
> {
> {{1, 1}}, {{1, 2}}, {{1, 3}},
> {{2, 1}}, {{2, 2}}, {{2, 3}},
> {{3, 1}}, {{3, 2}}, {{3, 3}}
> }
>
> Now pad a string or letter to the end of the each list within the list
> so u get...
>
> {{1, 1},string}, {{1, 2}, string}, {{1, 3}, string}
>
>  or sign
>
> {{1, 1},-}, {{1, 2},-}, {{1, 3},-}
>
> thanks in advance
>
> sean
>
>
Hi Sean,

You can use a rule like this:

yourarray /. {{x_, y_}} -> {{x, y}, "+"}


-----
Selwyn Hollis
http://www.appliedsymbols.com
(edit reply-to to reply)


  • Prev by Date: Question about composing a complex function.
  • Next by Date: Re: pattern matching and droping elements from list of lists.
  • Previous by thread: Pad a sign - and + to a list of lists
  • Next by thread: Re: Pad a sign - and + to a list of lists