Re: Manipulating Strings
- To: mathgroup at smc.vnet.net
- Subject: [mg28259] Re: Manipulating Strings
- From: bghiggins at ucdavis.edu (Brian Higgins)
- Date: Fri, 6 Apr 2001 01:53:07 -0400 (EDT)
- Organization: The Math Forum
- References: <x3ft7paewqs6@forum.mathforum.com>
- Sender: owner-wri-mathgroup at wolfram.com
I have made some improvements on my original function. It now handles arbitrary length sequence of characters: squash3[str_String] := Module[{SeqRule}, SeqRule = Join[Thread[ 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. Brian