MathGroup Archive 2001

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

Search the Archive

Re: Manipulating Strings

 I have made some improvements on my original function. It now handles
arbitrary length sequence of characters:

squash3[str_String] := Module[{SeqRule},
    SeqRule = 
          Map[# <> # &, CharacterRange["a", "z"]] -> 
            CharacterRange["a", "z"]], 
        Thread[Map[# <> # &, CharacterRange["A", "Z"]] -> 
            CharacterRange["A", "Z"]]]; 
    FixedPoint[StringReplace[#, SeqRule] &, str]]

Still seems a bit clunky. Any ideas how this may be further improved.


  • Prev by Date: Re: Serious bug in MatchQ causes crashes and incorrect results
  • Next by Date: Operations Research 2.0
  • Previous by thread: Re: Howto vonvert a list of functions in a list valued function
  • Next by thread: Manipulating Strings