Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Manipulating Strings

  • To: mathgroup at
  • Subject: [mg28259] Re: Manipulating Strings
  • From: bghiggins at (Brian Higgins)
  • Date: Fri, 6 Apr 2001 01:53:07 -0400 (EDT)
  • Organization: The Math Forum
  • References: <>
  • Sender: owner-wri-mathgroup at

 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