Created
March 6, 2013 02:39
-
-
Save xtman/5096278 to your computer and use it in GitHub Desktop.
The examples demonstrates how to replace a string in TCL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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