Replace and ReplaceAll -- simple application
- To: mathgroup at smc.vnet.net
- Subject: [mg105922] Replace and ReplaceAll -- simple application
- From: amannuc1 <Anthony.J.Mannucci at jpl.nasa.gov>
- Date: Sat, 26 Dec 2009 19:06:43 -0500 (EST)
I am doing some manipulations in Mathematica and end up with constructs such as "1." in the expressions. I want to convert these to "1" and thereby eliminate them. However, these examples don't seem to work. This is Mathematica 7 on OS X. In[40]:= Replace[1.(y1-1.yr),1.->1] Out[40]= 1. (y1-1. yr) (* Nothing happens *) In[39]:= ReplaceAll[1.(y1-1.yr),1.->1] Out[39]= y1-1. yr (* Only first one is replaced *) Any help is appreciated. Thanks. -Tony
- Follow-Ups:
- Re: Replace and ReplaceAll -- simple application
- From: "Scot T. Martin" <smartin@seas.harvard.edu>
- Re: Replace and ReplaceAll -- simple application
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Replace and ReplaceAll -- simple application