Skip to content

Instantly share code, notes, and snippets.

@xtman
Created March 6, 2013 02:39
Show Gist options
  • Save xtman/5096278 to your computer and use it in GitHub Desktop.
Save xtman/5096278 to your computer and use it in GitHub Desktop.
The examples demonstrates how to replace a string in TCL
# replace apple with orange
puts [string map {"apple" "orange"} "I like apple."]
# remove . in the string 3.8.001, prints 38001
puts [string map {. ""} 3.8.001]
# more about string map, see http://wiki.tcl.tk/10170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment