new files

This commit is contained in:
Ingy döt Net 2013-04-10 12:38:42 -07:00
parent 3af7344581
commit 86c034bb8b
1364 changed files with 21352 additions and 0 deletions

View file

@ -0,0 +1,36 @@
# string creation
set x "hello world"
# string destruction
unset x
# string assignment with a null byte
set x a\0b
string length $x ;# ==> 3
# string comparison
if {$x eq "hello"} {puts equal} else {puts "not equal"}
set y bc
if {$x < $y} {puts "$x is lexicographically less than $y"}
# string copying; cloning happens automatically behind the scenes
set xx $x
# check if empty
if {$x eq ""} {puts "is empty"}
if {[string length $x] == 0} {puts "is empty"}
# append a byte
append x \07
# substring
set xx [string range $x 0 end-1]
# replace bytes
set y [string map {l L} "hello world"]
# join strings
set a "hel"
set b "lo w"
set c "orld"
set d $a$b$c