MathGroup Archive 2000

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

Search the Archive

RE: working with large strings.

  • To: mathgroup at
  • Subject: [mg21685] RE: [mg21615] working with large strings.
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Sat, 22 Jan 2000 02:52:42 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Dustin Soodak  wanted an efficient way to change some characters in a very
long string.

Use the following:


StringReplacePart["string", "snew", {m, n}] replaces the characters at
positions m through n in "string" by "snew". StringReplacePart["string",
"snew", {{m1, n1}, {m2, n2}, ... }] inserts copies of "snew" at several
positions. StringReplacePart["string", {"snew1", "snew2", ... }, {{m1, n1},
{m2, n2}, ... }] replaces characters at positions mi through ni in "string"
by "snewi".

In the example below the 10th through 15th characters are replaced with



Ted Ersek

On 12-18-99 Mathematica tips, tricks at
had a major update

  • Prev by Date: Re: Integral of x/(1+x^4) problem (in Mathematica30)
  • Next by Date: RE: Intersection of 2 subspaces
  • Previous by thread: RE: working with large strings.
  • Next by thread: Header/Footer formatting question.