MathGroup Archive 2001

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

Search the Archive

Re: Manipulating Strings


StringReplace["CLKJLDiCXLklJDMXLKJdLmxLLLEIKXMDLKJcMDLKJXMeNNlB", {"LLL" ->
      "L", "NN" -> "N"}]

produces the output

"CLKJLDiCXLklJDMXLKJdLmxLEIKXMDLKJcMDLKJXMeNlB"

"Brian Higgins" <bghiggins at ucdavis.edu> wrote in message
news:9ajmoi$sav at smc.vnet.net...
> Dear Math group,
>
> I have a string with runs of repeated characters and  want to  replace
> sequences of repeated characters with a single character. For example
> consider the string
>
> "CLKJLDiCXLklJDMXLKJdLmxLLLEIKXMDLKJcMDLKJXMeNNlB"
> Thus I want a function that will take the groups "LLL" and "NN" in the
> above string and replace them with "L" and "N".
>...




  • Prev by Date: Re: I'm new
  • Next by Date: Re: Removing Audio "Clicking"
  • Previous by thread: Re: Manipulating Strings
  • Next by thread: Operations Research 2.0