Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
1
Task/String-length/Tcl/string-length-1.tcl
Normal file
1
Task/String-length/Tcl/string-length-1.tcl
Normal file
|
|
@ -0,0 +1 @@
|
|||
string length [encoding convertto utf-8 $theString]
|
||||
7
Task/String-length/Tcl/string-length-2.tcl
Normal file
7
Task/String-length/Tcl/string-length-2.tcl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
set s1 "hello, world"
|
||||
set s2 "\u304A\u306F\u3088\u3046"
|
||||
set enc utf-8
|
||||
puts [format "length of \"%s\" in bytes is %d" \
|
||||
$s1 [string length [encoding convertto $enc $s1]]]
|
||||
puts [format "length of \"%s\" in bytes is %d" \
|
||||
$s2 [string length [encoding convertto $enc $s2]]]
|
||||
1
Task/String-length/Tcl/string-length-3.tcl
Normal file
1
Task/String-length/Tcl/string-length-3.tcl
Normal file
|
|
@ -0,0 +1 @@
|
|||
string length "Hello, world!"
|
||||
5
Task/String-length/Tcl/string-length-4.tcl
Normal file
5
Task/String-length/Tcl/string-length-4.tcl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
fconfigure stdout -encoding utf-8; #So that Unicode string will print correctly
|
||||
set s1 "hello, world"
|
||||
set s2 "\u304A\u306F\u3088\u3046"
|
||||
puts [format "length of \"%s\" in characters is %d" $s1 [string length $s1]]
|
||||
puts [format "length of \"%s\" in characters is %d" $s2 [string length $s2]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue