This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
-
Nexus6
- Op
- Posts: 114
- Joined: Mon Sep 02, 2002 4:41 am
- Location: Tuchola, Poland
Post
by Nexus6 »
Lo,
I've used string map in a few scripts without probs, in one script I wanna replace { with ""
Code: Select all
set example2 [string map {"}" ""} $example1]
and it doesn't work (Tcl error [sb]: extra characters after close-brace) neither does
Code: Select all
set example2 [string map {} ""} $example1]
but it was obvious
I wonder how can be replacing { bracket with string map done
Thanks in advance for help
-
egghead
- Master
- Posts: 481
- Joined: Mon Oct 29, 2001 8:00 pm
-
Contact:
Post
by egghead »
You mean like:
Code: Select all
set string hehe\{\{haha
puts "STRING: $string"
puts "MAPPED: [string map { \{ new } $string]"
-
Nexus6
- Op
- Posts: 114
- Joined: Mon Sep 02, 2002 4:41 am
- Location: Tuchola, Poland
Post
by Nexus6 »
yay it works! Thanks a lot egghead
