Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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 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


  • 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