Reply To: Removing a }

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Removing a } Reply To: Removing a }

#59134
Charlie Bursell
Participant

    You are making this more difficult than it needs to be.  Use the string map command instead.  This command accepts a list of pairs where the first character of a pair is the part to find and teh second is the replacement.

    For example

    set replList

      set str “1\2/3-4.5}6”

      set newstr [string map $replList $str]

      echo $newstr

      123456

      In most cases the string map command is much faster plus you don’t have to escape as much.