MathGroup Archive 2011

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

Search the Archive

Re: Replace

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121079] Re: Replace
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Fri, 26 Aug 2011 05:24:48 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j35am1$og8$1@smc.vnet.net>

One possibility might be:

barF[{x_,y_}]:=Row[{"(", x, "|", y, ")"}]

{5,6}//barF    gives (5|6)

In:= barF/@{{5, 6}, {5, 8}, {-3, x}, {y, 1/2}}
Out= {(5|6),(5|8),(-3|x),(y|1/2)}

But you know, that you can use this for display only.

Sam Korn wrote:

> Hi, another stupid question. I have a list, and each element in the list is
> a sublist with a pair of integers. How do I replace each element along the
> lines of "{5,6}" with "(5|6)"?
>
> I know it's a stupid question, and there's probably something really obvious
> I'm missing, but I'm really new to Mathematica.
>
> Thanks!
> -Sam

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de




  • Prev by Date: Re: Replace
  • Next by Date: Re: Better use of PolynomialReduce?
  • Previous by thread: Re: Replace
  • Next by thread: Re: Replace